Hi, Thanks for the reply.
I used WSAGetLastError() just after SSL_read() and the result of this is "*Read failed with error 10054: An existing connection was forcibly closed by the remote host."* Warm regards, Arun S. ** On 7/31/07, jimmy bahuleyan <[EMAIL PROTECTED]> wrote: > > > Hi, > > Arun Singarajipura wrote: > > Hi All, > > > > we are working on client - server architecture. We are using openssl for > > communication. > > My problem is that - while transferring data, SSL_read() always fails > (after > > transferring few KB of data). > > The follwoing error is returned - > > > ---------------------------------------------------------------------------------- > > SSL_read() returns SSL_ERROR_SYSCALL > > > > "error:00000005:lib(0):func(0):DH lib" > > > ------------------------------------------------------------------------------- > > > > In that case you better check what errno has. That can give you a better > idea of what went wrong. (although i don't know why that "DH lib" is > present above. I don't think DH is involved in any SSL read/write unless > your handshake isn't over and your SSL_read() is in fact completing the > handshake). > > > This always happens between data transfer. > > > > Here's the code snippet > > gSSL = SSL_new(ctx); > > > > SSL_set_fd(gSSL, m_Socket); > > > > result = SSL_connect(gSSL); > > > > //Get certificate > > > > ** the following piece of code is giving problem > > > > ret=select(1,&sckt,NULL,NULL, &timeout); > > check what 'ret' is. > > > > > ERR_clear_error(); > > > > ret = SSL_read(gSSL,buffer,size); > > > > check errno here if you get a SSL_ERROR_SYSCALL. > > > -jb > -- > Tact is the art of making a point without making an enemy. > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > User Support Mailing List openssl-users@openssl.org > Automated List Manager [EMAIL PROTECTED] >