diff options
author | Florian Klink <flokli@flokli.de> | 2024-09-10 14:28:16 +0700 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2024-09-11 09:49:16 +0200 |
commit | 4d125be9d95dab786477e6881ab37e54334595ba (patch) | |
tree | c3e95786c527833c9b9cc86cf510887b9606b125 | |
parent | ed5da502cbb150982ad982211ad9475414b8689a (diff) | |
download | amtterm-4d125be9d95dab786477e6881ab37e54334595ba.tar.gz |
This is necessary to get past the SSL handshake in more recent versions
of openssl.
Still getting an "401 Unauthorized" with the system I've been testing
with, but that might already all that's needed for older systems.
Message-ID: <20240910072816.33197-1-flokli@flokli.de>
-rwxr-xr-x | amttool | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -3,6 +3,7 @@ use strict; use warnings; use SOAP::Lite; #use SOAP::Lite +trace => 'all'; +use IO::Socket::SSL; my $amt_host = shift; my $amt_port = "16992"; @@ -101,6 +102,16 @@ my %pt_status = ( my ($nas, $sas, $rcs); +IO::Socket::SSL::set_defaults( + SSL_create_ctx_callback => sub { + my $ctx = shift; + # SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION + Net::SSLeay::CTX_set_options($ctx, 0x00040000); + # Set SSL_verify_mode to SSL_VERIFY_NONE (do not verify the certificate) + Net::SSLeay::CTX_set_verify($ctx, Net::SSLeay::VERIFY_NONE, sub { 1 }); + }, +); + sub SOAP::Transport::HTTP::Client::get_basic_credentials { return $main::amt_user => $main::amt_pass; } |