> I think I have found a bug in OpenSSL on AIX 5.3 64-bit platform. > > When I try to connect by https from AIX to another host from multi-thread > application by curl, I have got error message SSL_CONNECT_ERROR "Unknown > SSL protocol error in connection to ...". After debugging I have found in > bss_sock.c file in BIO_sock_should_retry function ifdef statement (#if > defined(OPENSSL_SYS_WINDOWS) && 0), that incapsulate handling of > non-blocking socket returns. I think so, because in sock_read function > calling readsocket returns -1 and set errno to 0, and it' normal for > non-blocking sockets.
Why do you say that it's normal to return -1 and set errno to 0? For non-blocking sockets or not? Even AIX manual says it should be set to EAGAIN or EWOULDBLOCK. What is more likely to happen is that OpenSSL was compiled without threads support. In this case error value will go to thread-specific errno, while BIO_sock_should_retry would attempt to read global errno presumably from main thread. In this case question is where does your OpenSSL come from? Was it compiled without MT support? Why do you use it in MT application? If it's not case, then it's rather AIX bug than OpenSSL. The fact that removing #ifdef make the trick doesn't change the fact that it's AIX bug. What's your 'openssl version -a'? ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager majord...@openssl.org