OK ...これがもっと明確であるかどうかを見てみましょう。XML用のLWP :: UserAgent HTTPSサーバへのPOSTが動作しない
LWP :: UserAgentを経由してXML文書のPOSTをリモートのサードパーティサーバに行っています。
彼らは私のサーバーにインストールした.crtファイルを私に送ってきて、CPanelとPuttyコマンドラインの "locate"呼び出しによって、自分のアドレスとその存在を確認しました。証明書はそこにあります。
私は、LWP :: Protocol :: httpsと、Mozilla :: CA、Crypt :: SSLeayなどの他のすべての必要なPerlモジュールがインストールされていることを確認しました。
私はスクリプトを実行すると、私は次のエラーを取得する:
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;
}
任意の考え:
An Error Occurred
500 Can't connect to shortURL:port (certificate verify failed) 500 Can't connect to shortURL:port (certificate verify failed) 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 attempt 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 line 51.
ここでは、呼び出し元のコードですか?私はここでアイデアを使い果たしている。 :(
本当に 'shortURL:port'に接続しようとしていますか? –
これらは、実際のネットワークアドレス:ポート番号の代替値です。実際の値は "somedomain.com:443"のようになります。 –