I have a requirement where i need to make calls to SSL enabled website for processing payment gateway from my application with python 2.7.6 with openSSL 0.9.8. But when i call this website i get following error SSLError: [Errno 8] _ssl.c:507: EOF occurred in violation of protocol. This payment gateway only support TLS v1 and above and not SSL v2 and v3.

When i wireshark the request/response i get following below. The request doesnt move further and stop's there. I don't get any Server Hello message. SSLv2

I have tried the same with a .Net application and the link work perfectly. I have pasted the request/response from that call below. Here i also get a Server Hello and everything works like a charm.


I want to get this working with python 2.7.6. I suppose this is due to SSL protocol. But i am unable to upgrade my openSSL and get this working. What do you guys advice on this.

  • You could very well make this call with Python requests library. It takes care of SSL handshake to https websites.
    – sandyp
    Aug 10, 2016 at 18:34
  • OpenSSL 1.0.0 is 6 years, 19 weeks, 1 day, 6 hours and 39 minutes old. OpenSSL 1.0.1 is 4 years, 21 weeks, 1 day, 6 hours and 22 minutes old. Aug 10, 2016 at 21:31

1 Answer 1


Accrording to the wireshark pictures the .NET client is using TLS 1.2 while your Python program is using TLS 1.0 with a SSLv2 compatible handshake. TLS 1.2 is not supported with openssl 0.9.8. Support for TLS 1.2 was only added with OpenSSL 1.0.1. TLS 1.0 is supported by openssl 0.9.8 but it is unknown if the payment gateway really supports TLS 1.0 since due to PCI requirement several payment gateways require TLS 1.2 now.

But i am unable to upgrade my openSSL and get this working. What do you guys advice on this.

If TLS 1.2 is required by the payment gateway you've lost with your old OpenSSL version. If TLS 1.0 is possible one would need to see the code for your client and how it can be changed to not use a SSLv2 compatible handshake with TLS 1.0. But this part of the question would then be off-topic here and on-topic at stackoverflow.com.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .