Skip to content

Commit 5c8c6dc

Browse files
authored
Merge pull request #143 from timlegge/ssl-hostname
testapp: allow SOAP connections to untrusted SSL servers
2 parents 1dbe327 + f6740e4 commit 5c8c6dc

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

xt/testapp/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ force_authn: 1
2020
is_passive: 0
2121
sign_metadata: 1
2222
authnreq_signed: 1
23+
ssl_verify_hostname: 0

xt/testapp/lib/Saml2Test.pm

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ get '/logout-soap' => sub {
128128
)->as_xml;
129129

130130
my $soap = Net::SAML2::Binding::SOAP->new(
131-
key => 'sign-nopw-cert.pem',
132-
cert => 'sign-nopw-cert.pem',
133-
url => $slo_url,
134-
idp_cert => $idp_cert,
135-
cacert => config->{cacert},
131+
key => 'sign-nopw-cert.pem',
132+
cert => 'sign-nopw-cert.pem',
133+
url => $slo_url,
134+
idp_cert => $idp_cert,
135+
cacert => config->{cacert},
136136
);
137137

138138
my $res = $soap->request($logoutreq);
@@ -173,11 +173,16 @@ get '/consumer-artifact' => sub {
173173
my $sp = _sp();
174174
my $request = $sp->artifact_request($idp->entityid, $artifact)->as_xml;
175175

176+
my $ua = LWP::UserAgent->new;
177+
178+
require LWP::Protocol::https;
179+
$ua->ssl_opts( (verify_hostname => config->{ssl_verify_hostname}));
180+
176181
my $soap = Net::SAML2::Binding::SOAP->new(
177-
url => $art_url,
178-
key => 'sign-private.pem',
179-
cert => 'sign-certonly.pem',
180-
idp_cert => $idp_cert
182+
url => $art_url,
183+
key => 'sign-private.pem',
184+
cert => 'sign-certonly.pem',
185+
idp_cert => $idp_cert
181186
);
182187
my $response = $soap->request($request);
183188

0 commit comments

Comments
 (0)