Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number #12

Open
riramar opened this issue Aug 25, 2021 · 1 comment
Open

ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number #12

riramar opened this issue Aug 25, 2021 · 1 comment

Comments

@riramar
Copy link
Contributor

riramar commented Aug 25, 2021

Not sure why but for a few servers I'm getting the error below.

[INFO] Requesting - /
Traceback (most recent call last):
  File "/home/ricardo/Tools/h2csmuggler/h2csmuggler.py", line 382, in <module>
    init()
  File "/home/ricardo/Tools/h2csmuggler/h2csmuggler.py", line 378, in init
    main(args)
  File "/home/ricardo/Tools/h2csmuggler/h2csmuggler.py", line 252, in main
    sendSmuggledRequest(h2_connection,
  File "/home/ricardo/Tools/h2csmuggler/h2csmuggler.py", line 174, in sendSmuggledRequest
    events = getData(h2_connection, connection)
  File "/home/ricardo/Tools/h2csmuggler/h2csmuggler.py", line 106, in getData
    newdata = sock.recv(8192)
  File "/usr/lib/python3.9/ssl.py", line 1226, in recv
    return self.read(buflen)
  File "/usr/lib/python3.9/ssl.py", line 1101, in read
    return self._sslobj.read(len)
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:2622)

I've double checked and my python3 environment supports TLS 1.1, 1.2 and 1.3. Through the browser I see TLS 1.3.

Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> print(ssl.HAS_TLSv1_1)
True
>>> print(ssl.HAS_TLSv1_2)
True
>>> print(ssl.HAS_TLSv1_3)
True
>>> 

I'm using OpenSSL with the version below.

$ python3 -c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 1.1.1k  25 Mar 2021

I tried to disable (code below) a few TLS versions just for troubleshooting but nothing changes.

context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
context.options |= ssl.OP_NO_TLSv1_2 | ssl.OP_NO_TLSv1_1 | ssl.OP_NO_TLSv1

Did you get this error before using h2csmuggler?

@blshkv
Copy link

blshkv commented Jan 11, 2022

#14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants