Perl API Error: Can't verify SSL peers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2013 12:57 PM
I could use some help. I have downloaded the ServiceNow API, installed it and downloaded all the required Perl modules that have been suggested - I think. When I try to run a simple script I get the following error;
500 Can't verify SSL peers without knowning which Certificate Authorities to trust at /usr/lib/perl5/site_perl/5.8.8/ServiceNow/Connection.pm line 70.
The script is below;
#!/usr/bin/perl
use ServiceNow;
use ServiceNow::Configuration;
use strict;
print "Start Test\n";
my $CONFIG = ServiceNow::Configuration->new();
$CONFIG->setSoapEndPoint("https://xxxxxxxx.service-now.com/");
$CONFIG->setUserName("xxxxxxxxxxxx");
$CONFIG->setUserPassword("xxxxxxxxxxxx");
my $SN = ServiceNow->new($CONFIG);
my $me;
my $glideRecord = ServiceNow::GlideRecord->new($CONFIG,'cmdb_ci_list',$me);
my $gliderecords;
my $testIP = "nnn.nnn.nnn.nnn";
$gliderecords = $glideRecord->query({ 'ip_address'=> $testIP, 'install_status' => 'Installed', '__limit'=>'1000'});
print "RECORD: " . $gliderecords . "\n";
print "We B Done!\n";
Any help would be greatly appreciated.
~Ed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2013 07:20 AM
When I run the above script, I am getting the following error.
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 401 Unauthorized
Could this be a configuration problem?
All my packages are updated.
running perl 5.8.8 on redhat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2013 07:29 AM
That error usually comes from either: 1) not specifying credentials, 2) not specifying correct credentials, or 3)not specifying credentials with the proper rights when posting the web service request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2013 08:28 AM
Are these settings correct?
I am setting the user/passwd with:
$ENV{PROXY_user}='xxxx';
$ENV{PROXY_pass}='xxxx';
and
$CONFIG->setUserName("xxxx");
$CONFIG->setUserPassword("xxxx");
as show in the source above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2013 01:00 PM
This was an issue of the wrong proxy server. Once I switched to the correct proxy, I got all my information back.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2013 07:39 AM
I am setting the user/passwd with:
$ENV{PROXY_user}='xxxx';
$ENV{PROXY_pass}='xxxx';
and
$CONFIG->setUserName("xxxx");
$CONFIG->setUserPassword("xxxx");
as show in the source above.
I have also added user/passwd to the proxy address:
https://user:pwd\@proxy.com:443/