How to take the file 'ca.pem' to ‘/flash/cert/’?
-
when i use ssl module, how can i take the file 'ca.pem' to '/flash/cert/' ?
-
@DongYin
connect to it by ftp (wifi) and put file there
default ip is 192.168.4.1 user micro password python -
@livius Thanks for your explain, as your method i can view '/flash/' ,but can't write file to it.
-
@DongYin
Which tool do you use for ftp? And do you got some error when you put file?
In current firmware i have some problems with ftp stability
but i can put file by e.g. Filezilla -
@livius
I used 'freshftp' before, i can see the flash directory by this tool, but can't write file to flash.
then i used 'Filezilla', an error come out :"GnuTLS error -15: An unexpected TLS packet was received"
is there any settings required? -
@DongYin
look here - go to Filezilla section
https://docs.pycom.io/pycom_esp32/pycom_esp32/toolsandfeatures.html?highlight=filezilla -
@livius
Thank you! It works now. -
@livius
Is the ssl module OK? did you use it successful?
there aways output an OSError:-9984 -
@DongYin said in How to take the file 'ca.pem' to ‘/flash/cert/’?:
ssl
No, i did not used it. But you can see on the forum that few person use it succesfully.
What version of firmware do you have?os.uname() -
-
@DongYin
could you show some sample code?
it is something near this?
https://docs.pycom.io/pycom_esp32/library/ussl.htmlimport socket import ssl s = socket.socket() ss = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED, ca_certs='/flash/cert/ca.pem') ss.connect(socket.getaddrinfo('cloud.blynk.cc', 8441)[0][-1]) -
@livius
This is my ssl code.and WiFi is connect.
s = socket.socket()
#s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP)
ss = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED, ca_certs='/flash/cert/client.pem')
ss.connect(socket.getaddrinfo('192.168.119.38', 43416)[0][-1]) -
@livius
only socket is OK.
s = socket.socket()
s.connect(socket.getaddrinfo('192.168.119.38', 43414)[0][-1])By the way ,how to add my code with black backcolor?
-
@DongYin said in How to take the file 'ca.pem' to ‘/flash/cert/’?:
By the way ,how to add my code with black backcolor?
look here http://commonmark.org/help/
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login