New submission from Cédric Van Rompay <[email protected]>:
When calling ssl.get_server_certificate() with a bad port number (I used 80
when I should have been using 443), the error raised is a bit misleading:
>>> import ssl
>>> ssl.get_server_certificate(('gitlab.com',80))
[...]
SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:847)
"SSL: wrong version number" seems to indicate that there is a mismatch between
SSL versions supported by the client and the ones supported by the server. When
here I guess the problem would better be described as "there is no SSL
available at this address+port".
----------
assignee: christian.heimes
components: SSL
messages: 331171
nosy: cedricvanrompay, christian.heimes
priority: normal
severity: normal
status: open
title: misleading error message from ssl.get_server_certificate() when bad port
type: behavior
versions: Python 3.6
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35422>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com