Linuxサーバーから安らかなWebサービスを呼び出そうとしています。私はそれを呼び出すためにインクルードする.pemファイルを提供していましたが、私はどこのPERLスクリプトにそれを追加するのか分かりません。エラーPERLで安らかなWebサービスを呼び出すときにSSLクライアント証明書を含める方法
が私の.pemファイルが呼び出されます。私は、 "失敗した500のSSLネゴシエーション":受信し続ける
/u/data/aFolder/cert/theCert.pem
これは私が持っているもので私のPERLスクリプトの
#!/opt/standard_perl/perl5881/bin/perl -w
use strict;
use warnings;
use Data::Dumper;
use LWP::UserAgent;
use HTTP::Request;
use Crypt::SSLeay;
#Validates that a url is passed via the arguements
my $global_url;
if (!defined($ARGV[0]))
{
print "No URL passed";
exit 400;
}else
{
$global_url = $ARGV[0];
}
my $retry = 1;
# Retry logic, if service got a error code 500, it will
while ($retry <= 3)
{
# Connects to service, if response was sucessfull then it prints he content
# and exits the response code, else, retry 3 more times if the code was 500
my $response = connectToService($global_url);
if ($response->is_success)
{
print $response->content() . "\n";
exit($response->code);
}else
{
if ($response->code == 500 && $retry < 3)
{
$retry++;
next;
}
print $response->status_line() ."\n";
exit($response->code);
}
}
######################################
# Passes the url and calls the service
######################################
sub connectToService
{
my $url = shift;
my $agent = LWP::UserAgent->new;
my $request = HTTP::Request->new(GET => $url);
$request->header('Cache-Control' => 'no-cache');
$request->header('accept' => 'application/json');
return $agent->request($request);
}
私の結果であり、モーメントは次のとおりです。
[email protected]:/u/is/bin $ serviceCall.pl https://thewebServiceURL.com:3122/services/v1/quantity/foo/bar/info/11111
500 SSL negotiation failed:
[email protected]:/u/is/bin $
すべてのヘルプは大幅に
を高く評価しています