Skip Menu |
 

This queue is for tickets about the SOAP-Lite CPAN distribution.

Report information
The Basics
Id: 107924
Status: open
Priority: 0/
Queue: SOAP-Lite

People
Owner: Nobody in particular
Requestors: Steffen_Ullrich [...] genua.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Interaction with LWP broken regarding ssl_opts
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-19047-1445530973-69.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 984
Download (untitled) / with headers
text/plain 984b
If on is using ssl_opts like this: SOAP::Lite->proxy( 'https://...', ssl_opts => { SSL_ca_file => ... }) It will not set the given SSL options as one would expect. The reason is that SOAP::Transport::HTTP::Client::new will check for all arguments if there is a function with this name in LWP::UserAgent and in this case not give the arguments to new but to the functions. This means it will do the following $ua = LWP::UserAgent->new(...) # no ssl_opts $ua->ssl_opts({ SSL_ca_file => ... }) The last call will not set the ssl_opts in LWP::UserAgent but instead will treat the only argument as a string (i.e. "HASH(0x....")) and return the stored SSL option with this name. Giving instead ssl_opts as array ref works because in this case the array will be expanded when calling which will result in $ua->ssl_opts( SSL_ca_file => ... ) Note that the documentation explicitly states with an example that the ssl_opts should be given as a hash. Regards, Steffen
MIME-Version: 1.0
X-Spam-Status: No, score=-6.226 tagged_above=-99.9 required=10 tests=[AWL=0.374, BAYES_00=-1.9, FROM_OUR_RT=-4, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
In-Reply-To: <rt-4.0.18-19047-1445530973-613.107924-4-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-107924 [...] rt.cpan.org> <rt-4.0.18-19047-1445530973-613.107924-4-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Received: by 10.140.150.143 with SMTP id 137mr29809923qhw.48.1445655184408; Fri, 23 Oct 2015 19:53:04 -0700 (PDT)
Message-ID: <CAHrynWC62k+mR75tJN6rs8BAQbMfoRyqTsszyCrcLJf4VixXnA [...] mail.gmail.com>
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -6.226
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 1A36C61E006 for <cpan-bug+SOAP-Lite [...] hipster.bestpractical.com>; Fri, 23 Oct 2015 22:53:27 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2NNBUpBUEhhR for <cpan-bug+SOAP-Lite [...] hipster.bestpractical.com>; Fri, 23 Oct 2015 22:53:24 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id A393B240051 for <bug-SOAP-Lite [...] rt.cpan.org>; Fri, 23 Oct 2015 22:53:23 -0400 (EDT)
Received: (qmail 16756 invoked by alias); 24 Oct 2015 02:53:22 -0000
Received: from mail-qg0-f43.google.com (HELO mail-qg0-f43.google.com) (209.85.192.43) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 23 Oct 2015 19:53:16 -0700
Received: by qgbb65 with SMTP id b65so81383645qgb.2 for <bug-SOAP-Lite [...] rt.cpan.org>; Fri, 23 Oct 2015 19:53:04 -0700 (PDT)
Received: by 10.55.184.132 with HTTP; Fri, 23 Oct 2015 19:52:25 -0700 (PDT)
Delivered-To: cpan-bug+SOAP-Lite [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #107924] Interaction with LWP broken regarding ssl_opts
Return-Path: <fred [...] redhotpenguin.com>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+SOAP-Lite [...] hipster.bestpractical.com
X-RT-Mail-Extension: soap-lite
X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=E1ipJeIEhgdEd0unK8zxUwkJfGzP8bzOOnxdkl4+dUY=; b=OOoLYm18KoDkcyKDcMnsQmWIpHFebyh05RjoRPaJqMIlAnX78Z4sV1g8cM0Eu6NdV7 x8GbvO5F7jWKON9g4PQ5CinnrjBHxubEp+Q4lCrhiTt2IMwfGweD4noQwEcF64/Kaqb3 sdmrFHZxzSYsSGZm3/+WIqSBmpIWUaZL+mHUsODpbs6KQUUflxI/nfz/jRwSodjaC6LG fXIKyamFyApZ5gatrpbUCQwkb1WdvlRV/ELNZJHyp/Cs1NkmYdDZic8e7P6fvfcAEf+i 7FFxB+JU9/U6mMBKajFXxuhnIOeoaRLX5HvZcxlPWSQyNWPILn2qZyLsr3lbCem3gSwt iTzA==
Date: Fri, 23 Oct 2015 19:52:25 -0700
X-Spam-Level:
To: bug-SOAP-Lite [...] rt.cpan.org
X-GM-Message-State: ALoCoQnB+lbi/OVNe24QCfYfc+g9ptaGTEvFKN4ggI8dBUFxKX68Mg+2/lgEHBajjS9qLWjmi4mz
From: Fred Moyer <fred [...] redhotpenguin.com>
RT-Message-ID: <rt-4.0.18-21312-1445655207-1825.107924-0-0 [...] rt.cpan.org>
Content-Length: 1600
Download (untitled) / with headers
text/plain 1.5k
If you have a patch, I'd love a pull request at https://github.com/redhotpenguin/soaplite On Thu, Oct 22, 2015 at 9:22 AM, Steffen Ullrich via RT <bug-SOAP-Lite@rt.cpan.org> wrote: Show quoted text
> Thu Oct 22 12:22:53 2015: Request 107924 was acted upon. > Transaction: Ticket created by SULLR > Queue: SOAP-Lite > Subject: Interaction with LWP broken regarding ssl_opts > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: Steffen_Ullrich@genua.de > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=107924 > > > > If on is using ssl_opts like this: > > SOAP::Lite->proxy( 'https://...', ssl_opts => { SSL_ca_file => ... }) > > It will not set the given SSL options as one would expect. > > The reason is that SOAP::Transport::HTTP::Client::new will check for all arguments if there is a function with this name in LWP::UserAgent and in this case not give the arguments to new but to the functions. This means it will do the following > > $ua = LWP::UserAgent->new(...) # no ssl_opts > $ua->ssl_opts({ SSL_ca_file => ... }) > > The last call will not set the ssl_opts in LWP::UserAgent but instead will treat the only argument as a string (i.e. "HASH(0x....")) and return the stored SSL option with this name. > > Giving instead ssl_opts as array ref works because in this case the array will > be expanded when calling which will result in > > $ua->ssl_opts( SSL_ca_file => ... ) > > Note that the documentation explicitly states with an example that the ssl_opts > should be given as a hash. > > Regards, > Steffen
MIME-Version: 1.0
X-Spam-Status: No, score=-5.688 tagged_above=-99.9 required=10 tests=[AWL=0.921, BAYES_00=-1.9, FROM_OUR_RT=-4, RCVD_IN_DNSWL_LOW=-0.7, T_RP_MATCHES_RCVD=-0.01, UNPARSEABLE_RELAY=0.001] autolearn=ham
In-Reply-To: <rt-4.0.18-21312-1445655208-1638.107924-6-0 [...] rt.cpan.org>
Content-Disposition: inline
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-107924 [...] rt.cpan.org> <rt-4.0.18-19047-1445530973-613.107924-4-0 [...] rt.cpan.org> <CAHrynWC62k+mR75tJN6rs8BAQbMfoRyqTsszyCrcLJf4VixXnA [...] mail.gmail.com> <rt-4.0.18-21312-1445655208-1638.107924-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <20151025112901.GA28023 [...] genua.de>
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -5.688
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id BBC3424011A for <cpan-bug+soap-lite [...] hipster.bestpractical.com>; Sun, 25 Oct 2015 07:29:22 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xxqMFCcDf9Wl for <cpan-bug+soap-lite [...] hipster.bestpractical.com>; Sun, 25 Oct 2015 07:29:21 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id CDE42240003 for <bug-soap-lite [...] rt.cpan.org>; Sun, 25 Oct 2015 07:29:20 -0400 (EDT)
Received: (qmail 29093 invoked by alias); 25 Oct 2015 11:29:19 -0000
Received: from gg-0.genua.de (HELO gg.genua.de) (80.154.94.10) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sun, 25 Oct 2015 04:29:15 -0700
Received: from gg.genua.de (localhost.genua.de [127.0.0.1]) by gg.genua.de (8.15.1/8.15.1) with ESMTP id t9PBTAXO014875 for <bug-soap-lite [...] rt.cpan.org>; Sun, 25 Oct 2015 12:29:11 +0100 (CET)
Received: (from localhost) by gg.genua.de (MSCAN) id 5/gg.genua.de/smtp-gw/mscan; Sun Oct 25 12:29:10 2015
Delivered-To: cpan-bug+soap-lite [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #107924] Interaction with LWP broken regarding ssl_opts
User-Agent: Mutt/1.5.21 (2010-09-15)
Return-Path: <Steffen_Ullrich [...] genua.de>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+soap-lite [...] hipster.bestpractical.com
X-RT-Mail-Extension: soap-lite
Date: Sun, 25 Oct 2015 12:29:01 +0100
X-Spam-Level:
To: "fred [...] redhotpenguin.com via RT" <bug-SOAP-Lite [...] rt.cpan.org>
From: Steffen Ullrich <Steffen_Ullrich [...] genua.de>
RT-Message-ID: <rt-4.0.18-417-1445772564-56.107924-0-0 [...] rt.cpan.org>
Content-Length: 1339
Download (untitled) / with headers
text/plain 1.3k
On Fri, Oct 23, 2015 at 10:53:33PM -0400, "fred@redhotpenguin.com via RT" <bug-SOAP-Lite@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=107924 > > > If you have a patch, I'd love a pull request at > https://github.com/redhotpenguin/soaplite
Unfortunately it is not that clear how exactly this should be fixed, because there are several ways, like: - Update the documentation to make clear that ssl_opts should be an array, contrary to what the documentation currently says. This will not break any existing code, because it does not change how SOAP::Lite behaves. - Handle ssl_opts in a special way in SOAP::Lite, so that using a hash for ssl_opts works. To not break existing code one should handle the case with ssl_opts as an array like before. - Don't touch SOAP::Lite at all but instead change LWP::UserAgent::ssl_opts. Currently it assumes that if only a single argument is given this must be the key to the internal ssl_opts hash. But using a reference as a key makes no sense so one could add support for using a hash reference as an argument for ssl_opts without breaking existing code. I would actually favor the last option, because this way the method ssl_opts could also be used consistently to the attribute ssl_opts and not silently do nothing like it does now. Regards, Steffen
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-417-1445772564-56.107924-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <RT-Ticket-107924 [...] rt.cpan.org> <rt-4.0.18-19047-1445530973-613.107924-4-0 [...] rt.cpan.org> <CAHrynWC62k+mR75tJN6rs8BAQbMfoRyqTsszyCrcLJf4VixXnA [...] mail.gmail.com> <rt-4.0.18-21312-1445655208-1638.107924-6-0 [...] rt.cpan.org> <20151025112901.GA28023 [...] genua.de> <rt-4.0.18-417-1445772564-56.107924-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-22423-1488897081-43.107924-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1606
Download (untitled) / with headers
text/plain 1.5k
On Sun Oct 25 11:29:24 2015, SULLR wrote: Show quoted text
> On Fri, Oct 23, 2015 at 10:53:33PM -0400, "fred@redhotpenguin.com via > RT" <bug-SOAP-Lite@rt.cpan.org> wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=107924 > > > > > If you have a patch, I'd love a pull request at > > https://github.com/redhotpenguin/soaplite
> > Unfortunately it is not that clear how exactly this should be fixed, > because > there are several ways, like: > > - Update the documentation to make clear that ssl_opts should be an > array, > contrary to what the documentation currently says. This will not > break any > existing code, because it does not change how SOAP::Lite behaves. > - Handle ssl_opts in a special way in SOAP::Lite, so that using a hash > for > ssl_opts works. To not break existing code one should handle the > case with > ssl_opts as an array like before. > - Don't touch SOAP::Lite at all but instead change > LWP::UserAgent::ssl_opts. > Currently it assumes that if only a single argument is given this > must be > the key to the internal ssl_opts hash. But using a reference as a > key > makes no sense so one could add support for using a hash reference > as an > argument for ssl_opts without breaking existing code. > > I would actually favor the last option, because this way the method > ssl_opts > could also be used consistently to the attribute ssl_opts and not > silently > do nothing like it does now. > > Regards, > Steffen
The second of these approaches has been implemented in the repository. See https://github.com/redhotpenguin/soaplite/pull/27 for details of the PR.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.