Skip to content

https webhook receiver shows SSL wrong version issue #12

@Nockternal

Description

@Nockternal

HI guys i seem to be having a problem with the webhook receiver only on https. Http is working fine
output from the python receiver shows :

`102.132.225.115 - - [13/Jul/2021 05:44:49] "ü 5()û^È" HTTPStatus.BAD_REQUEST -
209.206.57.137 - - [13/Jul/2021 05:46:28] code 400, message Bad request syntax ('\x16\x03\x03\x01\x02\x01\x00\x00þ\x03\x03jö\x078¢ÒtmÝ\x00!\x8a)')
209.206.57.137 - - [13/Jul/2021 05:46:28] "þjö8¢ÒtmÝ!�)" HTTPStatus.BAD_REQUEST -
102.132.225.115 - - [13/Jul/2021 05:50:09] code 400, message Bad request version ("õáÂ'\x12oæ\x15K¹\x18\x08áR´Qú\x06Û¢\\x00e¸,©Á\x94·È\x00b\x13\x02\x13\x03\x13\x01À,À0À+À/̨̩\x00£\x00\x9f\x00¢\x00\x9e̪À¯À\xadÀ$À(À")
�â�)�Îy�BW Z õáÂ'oæKáR´QúÛ¢\e¸,©Á�·ÈbÀ,À0À+À/̨̩£�¢�̪À¯À­À$À(À" HTTPStatus.BAD_REQUEST -

`


when i generate a python based https request to the same location. i get the following:

`[Running] python -u "e:\Network Automation Development\Cisco\Meraki\webhook\sender.py"
Traceback (most recent call last):
File "C:\Users\burge\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 597, in urlopen
httplib_response = self._make_request(conn, method, url,
File "C:\Users\burge\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "C:\Users\burge\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 849, in validate_conn
conn.connect()
File "C:\Users\burge\AppData\Roaming\Python\Python39\site-packages\urllib3\connection.py", line 349, in connect
self.sock = ssl_wrap_socket(
File "C:\Users\burge\AppData\Roaming\Python\Python39\site-packages\urllib3\util\ssl
.py", line 372, in ssl_wrap_socket
return context.wrap_socket(sock)
File "C:\Python39\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Python39\lib\ssl.py", line 1040, in _create
self.do_handshake()
File "C:\Python39\lib\ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\burge\AppData\Roaming\Python\Python39\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\burge\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 637, in urlopen
retries = retries.increment(method, url, error=e, _pool=self,
File "C:\Users\burge\AppData\Roaming\Python\Python39\site-packages\urllib3\util\retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='41.87.229.9', port=44390): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "e:\Network Automation Development\Cisco\Meraki\webhook\sender.py", line 24, in
session.post(webhook_url,verify=False, data=json.dumps(data), headers={'Content-Type': 'application/json'})
File "C:\Users\burge\AppData\Roaming\Python\Python39\site-packages\requests\sessions.py", line 590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "C:\Users\burge\AppData\Roaming\Python\Python39\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\burge\AppData\Roaming\Python\Python39\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\burge\AppData\Roaming\Python\Python39\site-packages\requests\adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='41.87.229.9', port=44390): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)')))

[Done] exited with code=1 in 0.257 seconds`

I have looked at the SSL version and its quite new.
centos8# python3 whichssl.py OpenSSL 1.1.1g FIPS 21 Apr 2020 centos8#

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions