Subject: | Does not account for SSL-specific socket behaviors |
IO::Socket::SSL can't be used as a drop in replacement for a socket. There are at least the following issues to consider:
* selecting to read could block even though there is data already available from a previous SSL frame
* SSL could renegotiate, interrupting operations
I suggest reading https://metacpan.org/pod/distribution/IO-Socket-SSL/lib/IO/Socket/SSL.pod#Common-Usage-Errors
You may wish to see how HTTP::Tiny deals with these issues:
* https://github.com/chansen/p5-http-tiny/blob/master/lib/HTTP/Tiny.pm#L1401-L1403
* https://github.com/chansen/p5-http-tiny/blob/master/lib/HTTP/Tiny.pm#L1401-L1403
* Above requires newer IO::Socket::SSL and Net::SSLeay: https://github.com/chansen/p5-http-tiny/blob/master/lib/HTTP/Tiny.pm#L1401-L1403