HttpUtils.pm: fix SSL for noConn2 connects (FHEM2FHEM, DevIo.pm) (Forum #55194)

git-svn-id: https://svn.fhem.de/fhem/trunk@11758 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-07-07 14:09:30 +00:00
parent 5c2b43c815
commit 24a3e2c095
2 changed files with 8 additions and 3 deletions

View File

@ -257,8 +257,6 @@ HttpUtils_Connect($)
return $hash->{callback}($hash, "$host: ".strerror($errno), "")
if($errno);
return $hash->{callback}($hash,undef,undef) if($hash->{noConn2});
my $err = HttpUtils_Connect2($hash);
$hash->{callback}($hash, $err, "") if($err);
return $err;
@ -331,6 +329,11 @@ HttpUtils_Connect2($)
return "$hash->{displayurl}: Can't connect(2) to $hash->{addr}: $err";
}
if($hash->{noConn2}) {
$hash->{callback}($hash);
return undef;
}
my $data;
if(defined($hash->{data})) {
if( ref($hash->{data}) eq 'HASH' ) {

View File

@ -5,6 +5,7 @@ package main;
use strict;
use warnings;
use IO::Socket;
use vars qw($SSL_ERROR);
sub
TcpServer_Open($$$)
@ -102,7 +103,8 @@ TcpServer_Accept($$)
if( !$ret
&& $err != EWOULDBLOCK
&& $err ne "Socket is not connected") {
$err = "" if(!$err);
$err .= " ".($SSL_ERROR ? $SSL_ERROR : IO::Socket::SSL::errstr());
Log3 $name, 1, "$type SSL/HTTPS error: $err";
close($clientinfo[0]);
return undef;