わかりました...これがより明確かどうか見てみましょう。
LWP::UserAgent を介してリモートのサードパーティ サーバーに XML ドキュメントの POST を実行しています。
彼らは以前、私がサーバーにインストールした .crt ファイルを私に送信し、CPanel と Putty コマンド ラインの "locate" 呼び出しを介して、アドレスとそれらが存在するという事実を確認しました。証明書はそこにあります。
LWP::Protocol::https と、Mozilla::CA、Crypt::SSLeay などを含むその他すべての必要な Perl mod がインストールされていることを確認しました。
スクリプトを実行すると、次のエラーが表示されます。
エラーが発生しました
500 shortURL:port に接続できません (証明書の検証に失敗しました) 500 shortURL:port に接続できません (証明書の検証に失敗しました) Content-Type: text/plain Client-Date: Wed, 25 Jan 2012 17:53:36 GMT Client-Warning: Internal response Can't connect to shortURL:port (certificate verify failed) LWP::Protocol::https::Socket: SSL connect attempts failed with unknown errorerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed at / usr/lib/perl5/site_perl/5.8.8/LWP/Protocol/http.pm 51 行目。
呼び出しコードは次のとおりです。
sub ConsumerInfo {
my $cid = shift;
my $response = undef;
my $sendXML = &Create_ConsumerInfo_Request($cid);
if ($sendXML) {
&DoXMLUpload($sendXML);
my $browser = LWP::UserAgent->new(agent => 'site_perl',
ssl_opts => {
verify_hostname => 1,
SSL_ca_path => '/home/<mysite>/ssl/certs/',
},);
$browser->credentials('shortURL:port','realm','username'=>'password');
$response = $browser->request(POST 'longURL',
Content_Type => 'text/xml',
Content => $sendXML);
print "Content-type:text/html\n\n";
print $response->error_as_HTML unless $response->is_success;
print $response->as_string;
} else {
&ErrorMsg("No XML Code Was Found.");
exit;
}
# ===============================================================
# Need to insert parser in here to convert this into an array.
# ===============================================================
return $response;
}
何かご意見は?ここでアイデアが不足しています。:(