Very probably an error due to using non-blocking sockets: EWOULDBLOCK.
It's a retriable error.

For pure sockets I/O, no SSL, see W. Richard Stevens's books and other
resources on using nonblocking sockets with connect, read, write,
send, recv, etc.
On UNIX and Windows for pure sockets, most of the times, the way
forward is using select() at the proper spot. NOT so for SSL.

Since you have SSL stacked on top and get this from SSL_connect(), the
above is NOT all there is to it, as OpenSSL has additional, overriding
requirements.
See the SSL_connect man page and the nonblocking section there.
Also check the SSL_want man page.

Advance note:
If you want to use nonblocking I/O with openSSL, also heed the advice
in the SSL_read / SSL_write and SSL_want manual pages (and have a
close look at apps/s_client and apps/s_server source code). This
mailing list is quite lively with messages from people coding a
select() after every SSL_connect/read/write and having problems with
lockup and other issues: as the manpages indicate, select() isn't
quite everything there is to writing nonblocking I/O using OpenSSL, as
select() cannot be aware of the SSL state machine, while it should.
That's where SSL_want and related SSL error codes, such as
SSL_WANT_READ come into play. That is important during all phases of a
connection: at setup time (connect/handshake), transfer
(read/write/renegotiation) and termination (shutdown/close).



On Thu, Apr 9, 2009 at 11:29 PM, Dan Maartens <dan.maart...@gmail.com> wrote:
> Hello,
>
> I'm attempting to establish an SSL connection, where everything seems OK
> until SSL_connect, which returns -1. error is set to 11, and perror() gives
> "Resource temporarily unavailable." ERR_error_string rather useless output:
> error:00000002:lib(0):func(0):system lib, even though both
> SSL_load_error_strings() and ERR_load_crypto_strings() have been called.
>
> I'm stuck on this and any help would be greatly appreciated.
>
> Thanks
>



-- 
Met vriendelijke groeten / Best regards,

Ger Hobbelt

--------------------------------------------------
web:    http://www.hobbelt.com/
        http://www.hebbut.net/
mail:   g...@hobbelt.com
mobile: +31-6-11 120 978
--------------------------------------------------
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to