I'm using Requests 2.0.0 and failed to complete https GET request using:
requests.get('https://backend.iddiction.com/rest/v1/s2s/confirm_install?apphandle=slotsjourneyofmagic&appsecret=5100d103e146e2c3f22af2c24ff4e2ec&mac=50:EA:D6:E7:9B:C2&idfa=134DA32A-A99F-4864-B69E-4A7A2EFC6C25')
I get this Error:
[Errno 8] _ssl.c:504: EOF occurred in violation of protocol.
I read a lot of content on the web and on this site but every where i read it says that those problems fixed in version 2.0.0.
Can anyone advice here?
The server requires that you use SNI, which isn't normally available in Python 2.x.
If you open that URL in a browser and use Wireshark to trace out the TLS handshake, you can see that Chrome proposes the server name and that the remote server uses it to determine which certificate to use.
To make this work in Requests you can either use Python 3, which includes SNI support and which Requests will transparently make use of, or you can install the required dependencies for SNI in Python 2.x in Requests from this answer:
Either of those solutions will make your code work correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With