Skip to content

SSL deferred handshake #14216

Answered by dpgeorge
ma261065 asked this question in ESP32
Mar 30, 2024 · 3 comments · 5 replies
Discussion options

You must be logged in to vote

setting the socket to non-blocking before connecting the socket results in a OSError: [Errno 119] EINPROGRESS

That's actually the correct behaviour, because it's a non-blocking connect the call to s.connect() will return immediately and the connection will happen in the background.

For write, I can't keep writing the same data to the socket or it will get sent multiple times.

Yes, actually, that's what you need to do. The return value tells you how much was written, and you must try to write the remaining data again.

Here's some non-blocking SSL code that works for me (when run on the unix port of MicroPython):

from errno import EINPROGRESS
import select
import socket
import ssl


def m…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@ma261065
Comment options

ma261065 Mar 30, 2024
Author Sponsor

@sophiedegran
Comment options

Comment options

You must be logged in to vote
2 replies
@ma261065
Comment options

ma261065 Mar 30, 2024
Author Sponsor

@dpgeorge
Comment options

Answer selected by dpgeorge
Comment options

You must be logged in to vote
1 reply
@dpgeorge
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
ESP32
Labels
None yet
3 participants