summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/HAFAS.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2025-03-05 21:33:44 +0100
committerBirte Kristina Friesel <birte.friesel@uos.de>2025-03-05 21:35:21 +0100
commitb9116cbee16a91bec5eb3584431bac22759faef5 (patch)
tree76b0ed546578191a2a5825e22fa62c2af685b907 /lib/Travel/Status/DE/HAFAS.pm
parent5e77b1d20948233997fc03420cb986d14452ae62 (diff)
Disable all certificate checks for KVB
KVB appear to have misconfigured their TLS certificate
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS.pm')
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm6
1 files changed, 6 insertions, 0 deletions
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;
}