Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

rpc::xml::Client specify ssl_opts for requests

by rodrb (Initiate)
on Apr 09, 2013 at 15:12 UTC ( #1027763=perlquestion: print w/ replies, xml ) Need Help??
rodrb has asked for the wisdom of the Perl Monks concerning the following question:

I'm using RPC::XML::Client to access an internal server, i need to bypass proxy and i need to ignore certificate errors. This code correctly creates a $client

use IO::Socket::SSL qw( SSL_VERIFY_NONE ); use RPC::XML::Client; $ENV{NO_PROXY} = '10.*'; $ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0; my $client = RPC::XML::Client->new("https://10.40.1.114/api/index.ice" +, ssl_opts => { verify_hostname => 0, SSL_verify_mode => SSL_VERIFY_NONE } );

The next thing i need to do is to send requests such as:

my $session = $client->simple_request('login', 1, 0,$user, $password); +

Problem: I get this nasty warning for each request sent that i'd like to remove

******************************************************************* Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER together with SSL_ca_file|SSL_ca_path for verification. If you really don't want to verify the certificate and keep the connection open to Man-In-The-Middle attacks please set SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application. ******************************************************************* at C:/strawberry/perl/site/lib/LWP/Protocol/http.pm line 31

Somehow i need to be able to tell the request to use the same ssl_opts as when i create $client. I very much appreciate your help with this.

Comment on rpc::xml::Client specify ssl_opts for requests
Select or Download Code
Re: rpc::xml::Client specify ssl_opts for requests
by Loops (Hermit) on Apr 09, 2013 at 16:08 UTC
    Howdy, your code isn't actually passing the ssl_opts parameter to the LWP::UserAgent. This will work though:
    my $client = RPC::XML::Client->new("https://10.40.1.114/api/index.ice" +, useragent => [ ssl_opts => { verify_hostname => 0, SSL_verify_mode => SSL_VERIFY_NONE, }, ], );

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1027763]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2014-09-22 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (207 votes), past polls