Hi This is not an issue. U are using a non-blocking socket and thus u need to have a select call and put this socket on readable list and call SSL_read whenever this sockets becomes readable.. Other way round, make ur socket fd non-blocking (ioctl call) and than it will return after the connection is completed..
HTH -Krishna FSS, India On 8/11/06, Frank Büttner <[EMAIL PROTECTED]> wrote:
Hello, I try to set up an SSL connection, but it fails when I call SSL_connect() with SSL_ERROR_WANT_READ. I have written it it is show in the openSSL doc. To test it I run openssl s_server -accept 1234 -cert server.pem -state In my sample app I call SSL_CTX* K_OpenSSLVerbindung; SSL* K_SSLStruktur; int K_SSL_Fehlercode; SSL_library_init(); SSL_load_error_strings(); K_OpenSSLVerbindung=SSL_CTX_new(SSLv23_client_method()); K_SSLStruktur=SSL_new(K_OpenSSLVerbindung); SSL_set_fd(K_SSLStruktur,socketDescriptor()); K_SSL_Fehlercode=SSL_connect(K_SSLStruktur); K_SSL_Fehlercode will be -1 at this time. K_SSL_Fehlercode=SSL_get_error(K_SSLStruktur,K_SSL_Fehlercode); now it will be 2(SSL_ERROR_WANT_READ) socketDescriptor() will return an file descriptor of an QTcpSocket On the console in witch the openssl server runs I can read: SSL_accept:before/accept initialization SSL_accept:SSLv3 read client hello A SSL_accept:SSLv3 write server hello A SSL_accept:SSLv3 write certificate A SSL_accept:SSLv3 write key exchange A SSL_accept:SSLv3 write server done A SSL_accept:SSLv3 flush data any idea's what goes wrong??
______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]