Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: IO::Socket::SSL sometimes says 'SSL wants a read first'

by noxxi (Pilgrim)
on Apr 20, 2017 at 19:28 UTC ( [id://1188468]=note: print w/replies, xml ) Need Help??


in reply to IO::Socket::SSL sometimes says 'SSL wants a read first'

I don't think the code you show is enough to explain the problem. SSL wants to read first happens if non-blocking sockets are used or if you specify a timeout for the connection. The last case should be handled transparently for the user but in the first case you have to deal with want read first (SSL_WANT_READ) and want write first (SSL_WANT_WRITE) explicitly by waiting for the socket to be readable or writable using select or similar and then re-doing the failed action (read, write, connect_SSL, accept_SSL...) again. There is a part in the documentation of IO::Socket::SSL which deals with non-blocking sockets and describes how the handling differs from non-SSL sockets and what SSL_WANT_READ and SSL_WANT_WRITE mean.

As for the error about Interrupted system call: I think the origin of this must be somewhere in the code you did not show. The strace you show indicates that there happens a SIGCHLD, so an exit of a sub-process might be the cause of this problem. As with SSL_WANT_* you need to continue with the current operation if EINTR happens but this is expected when dealing with non-SSL sockets too.

  • Comment on Re: IO::Socket::SSL sometimes says 'SSL wants a read first'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1188468]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-24 22:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found