perl-IO-Socket-SSL/IO-Socket-SSL-2.067-openssl-1.1.1e.patch

45 lines
1.5 KiB
Diff

--- lib/IO/Socket/SSL.pm
+++ lib/IO/Socket/SSL.pm
@@ -38,6 +38,7 @@ BEGIN {
# results from commonly used constant functions from Net::SSLeay for fast access
my $Net_SSLeay_ERROR_WANT_READ = Net::SSLeay::ERROR_WANT_READ();
my $Net_SSLeay_ERROR_WANT_WRITE = Net::SSLeay::ERROR_WANT_WRITE();
+my $Net_SSLeay_ERROR_SSL = Net::SSLeay::ERROR_SSL();
my $Net_SSLeay_ERROR_SYSCALL = Net::SSLeay::ERROR_SYSCALL();
my $Net_SSLeay_VERIFY_NONE = Net::SSLeay::VERIFY_NONE();
my $Net_SSLeay_VERIFY_PEER = Net::SSLeay::VERIFY_PEER();
@@ -1196,6 +1197,11 @@ sub _generic_read {
last;
}
}
+ if ($err == $Net_SSLeay_ERROR_SSL) {
+ # OpenSSL 1.1.1e+
+ $data = '';
+ last;
+ }
$self->error("SSL read error");
}
return;
@@ -1274,6 +1280,11 @@ sub _generic_write {
}
if ( !defined($written) ) {
if ( my $err = $self->_skip_rw_error( $ssl,-1 )) {
+ # if ERROR_SSL then make it look like it used to do
+ if ( $err == $Net_SSLeay_ERROR_SSL ) {
+ $err = $Net_SSLeay_ERROR_SYSCALL;
+ $! = 0;
+ }
# if $! is not set with ERROR_SYSCALL then report as EPIPE
$! ||= EPIPE if $err == $Net_SSLeay_ERROR_SYSCALL;
$self->error("SSL write error ($err)");
--- t/core.t
+++ t/core.t
@@ -130,6 +130,7 @@ unless (fork) {
4.0,
ord("y"),
"Test\nBeaver\nBeaver\n");
+ Net::SSLeay::shutdown($client->_get_ssl_object);
shutdown($client, 1);
my $buffer="\0\0aaaaaaaaaaaaaaaaaaaa";