Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for RT 107924 #27

Merged
merged 3 commits into from Jun 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/SOAP/Transport/HTTP.pm
Expand Up @@ -124,6 +124,11 @@ sub new {

while (@methods) {
my ( $method, $params ) = splice( @methods, 0, 2 );
# ssl_opts takes a hash, not a ref - see RT 107924
if (ref $params eq 'HASH' && $method eq 'ssl_opts') {
$self->$method( %$params );
next;
}
$self->$method( ref $params eq 'ARRAY' ? @$params : $params );
}

Expand Down
16 changes: 16 additions & 0 deletions t/Issues/rt107924.t
@@ -0,0 +1,16 @@
use strict;
use warnings;
use Test::More tests => 2;
use SOAP::Lite;

my ($opts, $soap);
my $proxy = 'http://services.soaplite.com/echo.cgi';
my $cafile = '/foo/bar';

$opts = [ verify_hostname => 0, SSL_ca_file => $cafile ];
$soap = SOAP::Lite->proxy ($proxy, ssl_opts => $opts);
is ($soap->transport->ssl_opts ('SSL_ca_file'), $cafile, "ssl_opts as arrayref is honoured");

$opts = { verify_hostname => 0, SSL_ca_file => $cafile };
$soap = SOAP::Lite->proxy ($proxy, ssl_opts => $opts);
is ($soap->transport->ssl_opts ('SSL_ca_file'), $cafile, "ssl_opts as hashref is honoured");