Bu hatayı alıyorum. İşte benim kodum. Hata: 500 example.com:443'e bağlanamıyor (sertifika doğrulanamadı)
use LWP::UserAgent;
use HTTP::Request::Common qw(POST);
use HTTP::Cookies;
$URL="https://example.com/my.plicy";
$UA = LWP::UserAgent->new();
$UA->ssl_opts(verify_hostnames => 0);
#UA->ssl_opts(SSL_ca_file => Mozilla::CA::SSL_ca_file());
$req =HTTP::Request::Common::POST("$URL",
Content_type=>'form-data',
Content =>[
'username'=>'111',
'password'=>'2222',
'vhost'=>'standard'
]
);
$req->header('Cookie' =>q(TIN=287000; LastMRH_Session=439960f5; MRHSession=78c9c47291c1fcedae166121439960f5));
$resp=$UA->request($req);
if(($resp->code() >= 200) && ($resp->code() <400)) {
print $resp->decoded_content;
}else{
print "Error: ". $resp->status_line. "\n";
}
probelm
sitesi geliştirme aşamalarında olduğunu ve localhost sertifikası used..the tarayıcılar bunu tanıyamadım çünkü sağlamak için gerçek sertifikası olması.Doğrulamayı atlamanın bir yolu var mı? ve hatayı önlemek?
GÜNCELLEME:
Kodumu biraz değiştirdi. Başka bir kitaplık eklendi ve bu işlevi ekledi:
C'de
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER together with SSL_ca_file|SSL_ca_path for verification. If you really don't want to verify the certificate and keep the connection open to Man-In-The-Middle attacks please set SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
: /Perl/lib/LWP/Protocol/http.pm hat 31.
Bu yüzden bu almak için Asistan
use CACertOrg::CA;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
$UA->ssl_opts(
verify_hostnames => 0,
SSL_ca_file => CACertOrg::CA::SSL_ca_file()
);
bunun için seçenekler değiştirdi:
hiçbir şey printed..I iyi bir işarettir .. gerçi bir hata alamadım olsun$UA->ssl_opts(
SSL_verify_mode => 'SSL_VERIFY_NONE',
verify_hostnames => 0,
SSL_ca_file => CACertOrg::CA::SSL_ca_file()
);
?
Eh çok geç neredeyse 4 yıl oldu dene, fakat sorunun güncellenen bölümü ile ilgili olarak, Don' SSL_VERIFY_NONE öğesini tırnak içine koyun. Bu bir sabit, bir dizi değil. –