2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

HttpUtils.pm: Fix for SNI-Bug (Forum #48599)

git-svn-id: https://svn.fhem.de/fhem/trunk@10698 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-02-02 18:36:14 +00:00
parent a78711bc11
commit 92933594be

View File

@ -202,6 +202,7 @@ HttpUtils_Connect2($)
{
my ($hash) = @_;
$hash->{host} =~ s/:.*//;
if($hash->{protocol} eq "https" && $hash->{conn} && !$hash->{hu_sslAdded}) {
eval "use IO::Socket::SSL";
if($@) {
@ -213,6 +214,7 @@ HttpUtils_Connect2($)
IO::Socket::SSL->start_SSL($hash->{conn}, {
Timeout => $hash->{timeout},
SSL_version => $sslVersion,
SSL_hostname => $hash->{host},
%{$hash->{sslargs}}
}) || undef $hash->{conn};
$hash->{hu_sslAdded} = 1 if($hash->{keepalive});
@ -248,7 +250,6 @@ HttpUtils_Connect2($)
}
}
$hash->{host} =~ s/:.*//;
my $method = $hash->{method};
$method = ($data ? "POST" : "GET") if( !$method );