Hi all,
I was trying curl/libcurl compiled against OpenSSL 0.9.9.
I noticed a very strange behaviour that I was able to workaround with a
couple of sleep().
Curl fails to connect with:
curl: (52) SSL read: error:140943F2:SSL routines:SSL3_READ_BYTES:sslv3
alert unexpected message, errno 11
The behaviour is proper of the 0.9.9, neither 0.9.8 or 1.0.0 are
affected, however I'd like to understand which is the cause.
As far as I understand debugging, curl registers it's own BIO (socket)
for the SSL object:
curl-dist/lib/ssluse.c:1518
if(!SSL_set_fd(connssl->handle, sockfd)) {
...
My workaround is in ssl3_connect: just put a couple of sleep and
everything works well.
s3_clnt.c:
if (!SSL_in_init(s) || SSL_in_before(s)) SSL_clear(s);
*** sleep(1); ***
for (;;)
...
case SSL3_ST_CW_CLNT_HELLO_B:
s->shutdown=0;
ret=ssl3_client_hello(s);
if (ret <= 0) goto end;
s->state=SSL3_ST_CR_SRVR_HELLO_A;
s->init_num=0;
*** sleep(1); ***
/* turn on buffering ...*/
if (s->bbio != s->wbio)
s->wbio=BIO_push(s->bbio,s->wbio);
break;
Actually I went into more details, and I saw that the failure is due to:
ssl3_client_hello > ssl3_do_write > ssl3_write_bytes > do_ssl3_write >
ssl3_write_pending > BIO_write > b->method->bwrite
Unfortunately is quite difficult to debug, since debugging step by step
the connection slows down and --similarly as putting the sleep()--
everything goes well.
Any idea?
Best,
--
Emanuele Cesena <[email protected]>
Il corpo non ha ideali
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [email protected]