简体   繁体   中英

SSL_do_handshake() get stuck

in my code i call SSL_do_handshake() function. Everything works fine if the server gets the "right" messages. BUT, for security issues I tried sending a dummy message. just "hello" to the right port and the right ip address. in this case, SSL_do_handshake() gets stuck forever. I want the function to return in that case, so that my server will not get stuck.

What are the options ?

I read about setting bio to non-blocking.. I added to my code : BIO_set_nbio(bio, 1); before the connection is established.. but it didn't do thew work...

What can I do ?

BIO_set_nbio sets only the flag, that the bio should be considered non-blocking. You have to actually make the socket itself non-blocking.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM