Subject: | Return of undefined value. |
As this module naturally gets subclassed alot, it is a good practice to give clear errors. When I run with 'IO::Socket::SSL::DEBUG = 4;' I get a clear warning:
Failed to open Private Key
SSL error: 19024: 1 - error:02001002:system library:fopen:No such file or directory
SSL error: 19024: 2 - error:20074002:BIO routines:FILE_CTRL:system lib
SSL error: 19024: 3 - error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib
at /usr/lib/perl5/vendor_perl/5.8.5/IO/Socket/SSL.pm line 553
$VAR1 = undef;
But before I knew that the problem was with the cenrtificates I had to spend some time in the debugger. That's because of line 82 in IO::Socket::SSL
"${*$self}{'_SSL_ctx'} = new IO::Socket::SSL::SSL_Context($arg_hash) || return;"
Wich returns undef on failure. This get's passed onto HTTP::Daemon::SSL for example, and H:D:S on it's turn passes it as result of the ->new method. Now I didn't expect an undef when calling new. Ofcourse it's arguable H:D:S is in error, but what should H:D:S do then? Guess what went wrong and tell the user to turn the debug flag for I:S:S on?
Good luck!
Berik