-1
HTTPS 웹 사이트에 액세스하려하지만 오류가 발생합니다.Perl - HTTPS 웹 사이트 요청 방법
스크립트 1 :
use strict;
use warnings;
use LWP::UserAgent;
my $B = new LWP::UserAgent (agent => 'Mozilla/5.0', cookie_jar =>{});
my $GET = $B->get('https://moz.com')->content;
print $GET;
스크립트 2 :
use strict;
use warnings;
use LWP::UserAgent;
use Mozilla::CA;
my $B = new LWP::UserAgent (agent => 'Mozilla/5.0', cookie_jar =>{});
$B->ssl_opts(SSL_ca_file => Mozilla::CA::SSL_ca_file());
$B->ssl_opts(verify_hostname => 1);
my $GET = $B->get('https://moz.com')->content;
print $GET;
내가 모두이 오류가 발생합니다 :
Can't connect to moz.com:443
LWP::Protocol::https::Socket: SSL connect attempt failed with unknown error error:00000000:lib(0):func(0):reason(0) at C:/Perl/site/lib/LWP/Protocol/http.pm line 47.
내가 에서 ActivePerl를 사용하고 나는이 스크립트 시도 5.16.1 Build 1601 on Windows 7 Ultimate.
Perl을 사용하여 HTTPS 웹 사이트에 액세스하는 방법에 대해 알고 싶습니다.
모듈이 잘못 설치 되었습니까? 귀하의 코드는 나를 위해 매력처럼 작동합니다. 자신의 설정과 관련이 있습니다. 먼저 모듈을 다시 설치 한 다음 스크립트를 실행 한 시스템에서 https를 쿼리 할 수 있는지 확인합니다. –
어떤 코드입니까? 스크립트 1 또는 스크립트 2? – tr0in
@DavidVerdin ActivePerl을 다시 설치했지만 스크립트가 정상적으로 작동 중입니다. 답변 주셔서 감사합니다. – tr0in