usocket and ussl https server #14095
-
I'm trying to setup an https server with sockets and ssl in micropython as shown here http_server_ssl.py. When using exactly the example with the given Logs:
Error: Traceback (most recent call last):
File "<stdin>", line 95, in <module>
File "<stdin>", line 65, in main
OSError: (-30592, 'MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE') line 65: When using my own signed with open('certs/privkey.pem', 'rb') as f:
key = f.read()
with open('certs/cert.pem', 'rb') as f:
cert = f.read() I get an invalid key error: Traceback (most recent call last):
File "<stdin>", line 69, in <module>
File "<stdin>", line 39, in main
ValueError: invalid key Any help with setting up the https server would be appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@gringtc For |
Beta Was this translation helpful? Give feedback.
@gringtc
OSError: (-30592, 'MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE')
This is the browser response to a self-signed certificate, to avoid this you need to add the self-signed certificate to the trusted sources in chrome, see https://stackoverflow.com/questions/7580508/getting-chrome-to-accept-self-signed-localhost-certificate
For
ValueError: invalid key
see https://github.com/micropython/micropython/tree/master/tests#test-keycertificates instructions to generate a key/cert pair (MicroPython only supportsDER
format by default, unless usingesp32
port)