Forums

SSL: WRONG_VERSION_NUMBER error

I have a simple website that calls scripts include in the Django app. I try to launch my script from the bash console and I get this error. I read that oculd be a limitation of the free account...is it the case ? or there is other problems ?

 ENTERED PYTHON SCRIPT MAIN............... Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 521, in send
low_conn.endheaders()
File "/usr/local/lib/python3.10/http/client.py", line 1277, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.10/http/client.py", line 1037, in _send_output
self.send(msg)
File "/usr/local/lib/python3.10/http/client.py", line 975, in send
self.connect()
File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
File "/usr/local/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "/usr/local/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/local/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/usr/local/lib/python3.10/ssl.py", line 1071, in _create
self.do_handshake()
File "/usr/local/lib/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/vds89/transcritpion_project/trans_app/scripts/main_tr.py", line 24, in <module>
audio_url = upload(file_path)
File "/home/vds89/transcritpion_project/trans_app/scripts/api_02.py", line 34, in upload
upload_response = requests.post(upload_endpoint, headers=headers_auth_only, data=read_file(filename), 
verify=False)
File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 547, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)

Then I also got this other error if I try to use the website normally (It allow to upload a file that will be processed trought an API call and give back another file to be dowloaded)

Traceback (most recent call last):#012  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 521, in send#012    low_conn.endheaders()#012  File "/usr/local/lib/python3.10/http/client.py", line 1277, in endheaders#012    self._send_output(message_body, encode_chunked=encode_chunked)#012  File "/usr/local/lib/python3.10/http/client.py", line 1037, in _send_output#012    self.send(msg)#012  File "/usr/local/lib/python3.10/http/client.py", line 975, in send#012    self.connect()#012  File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 414, in connect#012    self.sock = ssl_wrap_socket(#012  File "/usr/local/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket#012    ssl_sock = _ssl_wrap_socket_impl(#012  File "/usr/local/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl#012    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)#012  File "/usr/local/lib/pyth

Could you help to solve this issue ?

EDIT: I upgraded to Hacker account and it works correctly

Glad you got it working