Page 1 of 1

SSL_READ and SSL_WRITE with timeouts non-blocking

Posted: Tue Mar 07, 2017 9:16 am
by preetam
Hi,

I would like to issue a timeout on ssl_read and ssl_write after a few seconds.
is there a api for this in non-blocking way.

Thanks
Paul

Re: SSL_READ and SSL_WRITE with timeouts non-blocking

Posted: Thu Mar 09, 2017 3:16 pm
by f.h-f.s.
Hi, I use this to set my ssl connection to non-blocking.
SSL_get_fd(1) is from openssl/ssl.h
fcntl(3) is from lwip/sockets.h see lwip_fcntl

Code: Select all

	//non-blocking connection
	int fd = SSL_get_fd(_ssl);
	fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
	SSL_set_fd(_ssl, fd);

Re: SSL_READ and SSL_WRITE with timeouts non-blocking

Posted: Fri Mar 10, 2017 9:27 am
by preetam
Thank you for the information.
I will try to run some code using this.