Certificate error SSLV3_ALERT_CERTIFICATE_UNKNOWN
When I run:
generate_cert.sh
python3 simple_server.py
Starting server...
Using TLS with keys in ''
Listening on https://:8443
Then go to:
https://192.168.1.1:8443/
I get the classic:
Your connection is not private
NET::ERR_CERT_INVALID
...the website sent back unusual and incorrect credentials. This may happen when an attacker is trying to pretend to be 192.168.1.1, or a Wi-Fi sign-in screen has interrupted the connection. Your information is still secure because Google Chrome stopped the connection before any data was exchanged.
You cannot visit 192.168.1.1 at the moment because the website sent scrambled credentials that Google Chrome cannot process. Network errors and attacks are usually temporary, so this page will probably work later.
And in the console:
SSL handshake failed
protocol: <asyncio.sslproto.SSLProtocol object at 0xb607b2f0>
transport: <_SelectorSocketTransport fd=8 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
File "/usr/lib/python3.7/asyncio/sslproto.py", line 625, in _on_handshake_complete
raise handshake_exc
File "/usr/lib/python3.7/asyncio/sslproto.py", line 189, in feed_ssldata
self._sslobj.do_handshake()
File "/usr/lib/python3.7/ssl.py", line 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1056)
The cert seems fine:
-rw------- 1 pi pi 3272 Mar 28 16:38 key.pem
-rw-r--r-- 1 pi pi 1814 Mar 28 16:38 cert.pem
-----BEGIN CERTIFICATE-----
MIIFDTCCAvWgAwIBAgIUWd+RmgJ
...etc
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAA
...etc
Python 3.7 SSL:
>>> print(ssl)
<module 'ssl' from '/usr/lib/python3.7/ssl.py'>
Chrome 89 for Mac.
Why is this?