python https requests failing with TLSV1_ALERT_INTERNAL_ERROR

Viewed 68

We are using requests.post for sending https request to one of the server which has SNI enabled.

resp = requests.post(registration_url,
                         data=json.dumps(request_payload),
                         headers=headers
                         )

Our python service which uses python 2.7.5 version, giving below error for this request.

[SSL: TLSV1_ALERT_INTERNAL_ERROR] tlsv1 alert internal error (_ssl.c:618)

In the same machine, if we open python 2.7.5 cli and invoke the above requests.post then request is going through and getting response back. Not getting any tls error.

We checked the tcpdump of ssl handshake for both the requests, and found that

  1. Request sent from the service doesn't have SNI populated in it
  2. Request sent from the python cli has SNI populated in it..

How can we debug, why SNI is not getting populated when request is invoked from the service?

0 Answers
Related