Closed kiranns closed 5 years ago
tls_client_connect builds the TLS client hello. It doesn’t perform any socket I/O (or tcp-layer connect). It just builds the client hello. Then you may call socket and sendto for the pending tls buffer. I really don’t see any problem.
Previous exchange of this issue (in the context of #38)
=================== For TCP fast open+ TLS you should do something like this: tls_sni_set(context, "hostname"); tls_client_connect(context)
connect(sockfd, ...) // do your TCP-related stuff here tls_get_write_buffer(context, ...);
TCP FAST Open is not like any of the other options in TCP. Here, we have to send the first message of the TLS exchange ('Client Hello') message along with the SYN of the TCP connection, i.e. even before the "connect(sockfd)" call. Hence it needs specific changes at the TLS level.
From https://lwn.net/Articles/508865/, we need something along these lines : sfd = socket(AF_INET, SOCK_STREAM, 0);
It would be nice if you can help with addressing this issue.