1

I am using python-requests to perform get requests to some resources. In staging and production environments things works out fine, but in the test environment with a slightly different setup, I receive the message below when trying to perform the request:

requests.exceptions.SSLError: [Errno 1] _ssl.c:510: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac

I have tried using an adapter as specified here: SSL Error on Python GET Request I have tried all the protocols in the list. Still no luck. I have tried mounting both the complete url and the domain url. No difference.

Any ideas on what to try next?

Community
  • 1
  • 1
  • "bad record mac" can be anything. Find out what exactly is different, i.e. different libraries, different server etc. Try client against different servers, try server from other clients etc. Then add all these details to the question. See also http://noxxi.de/howto/ssl-debugging.html for debugging help. – Steffen Ullrich Dec 19 '14 at 09:44
  • Hi ! I have tried the client against different servers. Works fine against the other servers.. – user3811455 Jan 06 '15 at 12:40
  • I have tried creating a simple java client, using standard java.io. This client is able to get data from the test environment. I have tried communicating with the test environment using the python client through a http proxy running on my machine. Also works fine. I have used wireshark to locate differences in the communication with the test environment and the staging environment. I see one important difference. The test environment sends a RST, ACK which terminates the communication. – user3811455 Jan 06 '15 at 12:47
  • I also see an Encrypted Alert message from the server, which I guess initiates the close of the connection. The question is why. – user3811455 Jan 06 '15 at 13:06
  • Look at the differences in the ClientHello, i.e. different ciphers, different protocol version, usage of SNI extension etc. If you need help interpreting the results put a capture of a good and a bad connection to cloudshark.org. – Steffen Ullrich Jan 06 '15 at 13:21

0 Answers0