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

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@10698 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2016-02-02 18:36:14 +00:00
parent 1f5e28b769
commit ca5bcce123

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 );