1

When I tested some Python code for different scenarios, I received the following error for the correct port, URL, username, and password:

SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message 

I got the exact same error and traceback when I used a bogus username, and also when I used the correct username but the wrong password. Could it be expecting SSL v3, and the version that is installed is older? Just a guess. I didn't see anything in the Python code that set the SSL version number.

4
  • Please post a minimal reproducible example so that people can examine your code and see if there is something wrong there. Commented Dec 21, 2016 at 0:32
  • It sounds like you are using Python2.7 and a 3rd party library like requests. If this is the case you should try this pip install request[security] most packages that I have run into that have to deal with this will have the [security] version. Commented Dec 21, 2016 at 1:46
  • Sorry, I am not allowed to post any code because it is proprietary. Commented Dec 21, 2016 at 19:43
  • For what it's worth, here are the last several lines of the traceback. The Python code referenced is in GitHub at github.com/kennethreitz/requests Commented Dec 22, 2016 at 19:02

2 Answers 2

1

Please can you post the code so that It is easy to resolve the problem. This link may help you [SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message

Sign up to request clarification or add additional context in comments.

1 Comment

API.py line 88 -> API.py line 44 -> sessions.py line 335 -> sessions.py line 438 -> adapters.py line 331
0

You can use SSLAdapter to set the SSL and TLS versions.

I was getting a similar error and it was caused by the server using TLS 1.3, but I only have TLS 1.2 installed. So I had to do the following:

from requests_toolbelt import SSLAdapter import ssl import requests session = requests.Session() session.mount('https://', SSLAdapter(ssl.PROTOCOL_TLSv1_2)) session.get(myurl) 

If you can reach the server with a browser, you can check the SSL and TLS version by clicking on the lock or shield symbol next to the url.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.