cURL / Mailing Lists / curl-library / Single Mail


Re: openSSL SSL_connect fails

From: Dan Fandrich <>
Date: Mon, 21 Feb 2011 18:41:49 -0800

On Mon, Feb 21, 2011 at 06:21:26PM -0800, Prashant R wrote:
> My IP stack is lwip and I have libcurl using lwip sockets for my platform  . 
> I find that  the SSL_connect() in ossl_connect_step2() defined in ssluse.c
> fails . 
> The error detail is not SSL_ERROR_WANT_READ nor SSL_ERROR_WANT_WRITE 
> when I do a perror it says "bad file descriptor" 
> Would this be because openSSL does not know about lwip and tries to use a
> standard BSD socket API ? 

Yes, very likely.

> I am using a stock implementation of openSSL . Do i have to also modifying
> openSSL to use lwip  . I am a little unclear about the dependencies here. 

If you're running lwIP on an OS that already supports a socket API, then it's
likely running entirely in user space. That means programs can't use the OS-
provided functions like recv, write and select on lwIP PCBS and expect
anything useful to happen. If you've ported libcurl to use lwIP, then any
other libraries that operate on network file descriptors, like OpenSSL, will
need to be modified to use lwIP as well.

If you're going to be porting an SSL library to lwIP, I suggest looking at
one of the other ones supported by libcurl (e.g. one of the ones noted as
"small" at

>>> Dan
List admin:
Received on 2011-02-22