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
‎08-20-2013 07:00 AM
Did you ever figure this out? I tried your perl script and it worked just fine for me. You might want to retry installing the pre-requisites to ensure you haven't missed anything. They are:
SOAP::Lite
Crypt::SSLeay
IO::Socket::SSL
File::Basename
MIME::Types
MIME::Type
MIME::Base64
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2013 05:56 AM
John,
Nope. I haven't had the time. Like everyone else in this business I'm slammed.
But I will review the list of prerequisites ~just to make sure~ when I get a second. The funny thing is, I'm trying to get this app to run on a Linux development server. I have written ServiceNow code from scratch on this server and it runs fine. The code that is having issues came from a SUN Sparc environment where it runs without problems. It ~should~ be compatible.
Thanks for the suggestion.
~Ed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2013 06:20 AM
I did a quick google search for that error, and a lot of people receiving that error string needed to install the "Mozilla::CA" perl module.
This is not listed as a pre-requisite, but I noticed my system already came with Mozilla::CA installed with perl. Curious to know if yours has that module or not.
A simple "perldoc Mozilla::CA" command in the shell should show you the documentation for the module if it is installed. If it is not installed, no documentation would show up for you and you would know that it may need to be installed first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2013 09:25 AM
John,
I was able to install/update all the modules above. Status was as follows;
SOAP::Lite Went through an install/update
Crypt::SSLeay Was up to date
IO::Socket::SSL Was up to date
File::Basename Will not install. (Discovered it was a core module. Was already installed.)
MIME::Types Went through an install/update
MIME::Type Was up to date
MIME::Base64 Went through an install/update
Mozilla::CA Went through an install/update
Reran the script and it worked well. I don't know what install/update addressed the issue, (I ~think~ it was the SOAP::Lite module), but it worked. Thanks for the help on this one.
~Ed