2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-15 22:26:04 +00:00

HttpUtils.pm: enclose IO::Socket::SSL->start_SSL into eval (Forum #129212)

git-svn-id: https://svn.fhem.de/fhem/trunk@26409 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2022-09-17 13:09:15 +00:00
parent 7b4cbe8445
commit 75b745e81d

View File

@ -510,12 +510,19 @@ HttpUtils_Connect2NonblockingSSL($$)
$hash->{conn}->blocking(0);
$par->{SSL_startHandshake} = 0;
if(!IO::Socket::SSL->start_SSL($hash->{conn}, $par) ||
$hash->{conn}->connect_SSL() ||
$! != EWOULDBLOCK) {
eval {
if(!IO::Socket::SSL->start_SSL($hash->{conn}, $par) ||
$hash->{conn}->connect_SSL() ||
$! != EWOULDBLOCK) {
HttpUtils_Close($hash);
return $hash->{callback}($hash,
"$! ".($SSL_ERROR ? $SSL_ERROR : IO::Socket::SSL::errstr()));
}
};
if($@) {
Log3 $hash, $hash->{loglevel}, $@;
HttpUtils_Close($hash);
return $hash->{callback}($hash,
"$! ".($SSL_ERROR ? $SSL_ERROR : IO::Socket::SSL::errstr()));
return $hash->{callback}($hash, $@);
}
$hash->{FD} = $hash->{conn}->fileno();