redhotpenguin/soaplite — pull request #10 by ivkosh (2014-02-14 22:51:10+00:00)
Title: Update Lite.pm

There is a bug when SOAP::Lite is trying to parse WSDL definition by https with custom settings (e.
g. with certificate authentication added by $soap->schema->useragent->ssl_opts(...) or by custom user agent) and this top-level WSDL has link to other WSDL-definition, like this:

Imported location is being accessed by https, but without custom ssl_opts or using default user agent - custom user agent is not used in sub "parse" when new SOAP::Schema::WSDL object is created.

Example of such code:

my $soap = SOAP::Lite->new;
$soap->schema->useragent->ssl_opts(
SSL_use_cert => 1,
SSL_cert_file => 'mycert.pem',
SSL_key_file => 'mykey.pem',
);
$soap->service(WSDL_URI);

In this case, if WSDL_URI has tag with other location, this location is being accessed without mycert.pem & mykey.pem (which leads to "Forbidden" in most cases).
And in this case error diagnostic is somewhat confused, especially if you are using self-signed certs, because it warns, that LWP could not verify https-site and asks about ca-certs (and if you turn on debug3 on IO::Socket::SSL you can see, that it complains only on second https-connect).

The reason of error is, that custom schema->useragent from SOAP::Lite object was not reused when SOAP::Schema::WSDL object is created to parse imported location.

The following patch solves this problem.