From b9116cbee16a91bec5eb3584431bac22759faef5 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 5 Mar 2025 21:33:44 +0100 Subject: Disable all certificate checks for KVB KVB appear to have misconfigured their TLS certificate --- lib/Travel/Status/DE/HAFAS.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Travel/Status/DE/HAFAS.pm') diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index 53eb467..f96ac2c 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -12,6 +12,7 @@ use DateTime; use DateTime::Format::Strptime; use Digest::MD5 qw(md5_hex); use Encode qw(decode encode); +use IO::Socket::SSL; use JSON; use LWP::UserAgent; use Travel::Status::DE::HAFAS::Journey; @@ -52,6 +53,11 @@ sub new { $lwp_options{proxy} = [ [ 'http', 'https' ] => $proxy ]; } } + if ( $service and not $hafas_instance->{$service}{tls_verify} ) { + $lwp_options{ssl_opts}{SSL_verify_mode} + = IO::Socket::SSL::SSL_VERIFY_NONE; + $lwp_options{ssl_opts}{verify_hostname} = 0; + } $ua = LWP::UserAgent->new(%lwp_options); $ua->env_proxy; } -- cgit v1.2.3