TStanley has asked for the wisdom of the Perl Monks concerning the following question:
which produced the following error:#!C:\Perl64\bin\perl use strict; use warnings; use Confluence::Client::XMLRPC; my $version=2; Confluence::Client::XMLRPC::setApiVersion($version); Confluence::Client::XMLRPC::setRaiseError(1); Confluence::Client::XMLRPC::setPrintError(1); my $URL="https://jeeves.Mainoffice.Demoulas.Corp/rpc/xmlrpc/"; my $user="toms"; my $pass="password"; my $object = Confluence::Client::XMLRPC->new($URL,$user,$pass); $object->logout();
After a great deal of trial and error, I got the code below working:XML-RPC ERROR: Unable to connect to https://jeeves.Mainoffice.Demoulas +.Corp/rpc/xmlrpc at C:\Users\toms\Documents\Confluence\confluence.pl line 15
The catch is where I create the LWP object, telling the agent to not verify the hostname of the server. If I remove the ssl_opts, it will say it can not connect due to failing the certificate verification. The Confluence client in the first bit of code uses LWP and LWP::Protocol::https to handle the http/https part of connecting to the server. What I need to figure out is how I can pass the ssl_opts.#!C:\Perl64\bin\perl use warnings; use strict; use LWP::UserAgent; my $ua=LWP::UserAgent->new(ssl_opts=>{ verify_hostname => 0}); my $req = HTTP::Request->new(GET => 'https://jeeves.mainoffice.demoula +s.corp'); my $result = $ua->request($req); if($result->is_success){ print $result->content; }else{ print $result->status_line, "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Working with Confluence and LWP
by tangent (Parson) on Jul 28, 2015 at 18:43 UTC | |
by TStanley (Canon) on Jul 28, 2015 at 18:47 UTC | |
|
Re: Working with Confluence and LWP
by 1nickt (Canon) on Jul 28, 2015 at 17:48 UTC | |
|
Re: Working with Confluence and LWP
by GotToBTru (Prior) on Jul 28, 2015 at 20:07 UTC | |
|
Re: Working with Confluence and LWP
by TStanley (Canon) on Jul 30, 2015 at 13:10 UTC | |
by Anonymous Monk on Dec 23, 2015 at 13:41 UTC |