← index #3646Issue #2781
Related · high · value 2.904
QUERY · ISSUE

ussl.wrapsocket and mbedtls

openby tsc87opened 2018-02-28updated 2023-03-28
extmod

The function arguments for ussl.wrapsocket for ESP32 do not match with the documentation. ussl.wrap_socket(sock, server_side=False, keyfile=None, certfile=None, cert_reqs=CERT_NONE, ca_certs=None)
It seems that the modussl_mbedtls file has a modified function that has parameters listed as "key" and "cert" and missing argument for ca_cert.
Also, in socket_new, the call to mbedtls_ctr_drbg_seed takes null_entropy_func instead of mbedtls_entropy_func.
How to make the ussl.wrapsocket working for ESP32 for use with AWS IoT?

CANDIDATE · ISSUE

Add ssl certificates on ESP8266

closedby Lir10opened 2017-01-11updated 2025-02-04
port-esp8266proposed-close

Hi ,

I'm trying to connect to ssl server using this code :

>>>import usocket                                                                                                       
>>> import ussl                                                                                                          
>>> s = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)                                                             
>>> ss = ussl.wrap_socket(s,  ca_certs='/flash/cert/ca.pem')     

However , im getting the following traceback :

Traceback (most recent call last):                                                                                       
  File "<stdin>", line 1, in <module>                                                                                    
TypeError: extra keyword arguments given 

Looks like

ussl.wrap_socket()

works only with one argument.

How can i add my own self signed certificates to the ssl socket object?

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied