質問編集履歴
2
追加で色々やってみました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -87,3 +87,71 @@
|
|
87
87
|
print $source;
|
88
88
|
|
89
89
|
```
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
Perl本体やモジュールがおかしいのか気になり、コードを以下に書き換え、strawberry-perl(Portable)と上記のActivePerlで試して見ました。それぞれ以下のエラーが表示されました。
|
96
|
+
|
97
|
+
なお、opensslは
|
98
|
+
|
99
|
+
Win64OpenSSL_Light-1_0_0e.exe
|
100
|
+
|
101
|
+
Win64OpenSSL-1_1_1g.exe
|
102
|
+
|
103
|
+
Win64OpenSSL_Light-1_1_1g.msi
|
104
|
+
|
105
|
+
をそれぞれ試してみましたが無理でした。
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
strawberry-perl(Portable)
|
110
|
+
|
111
|
+
Can't connect to yahoo.jp:443 (Bad file descriptor)
|
112
|
+
|
113
|
+
Bad file descriptor at C:/PortableApp/strawberry-perl-5.32.0.1-64bit-PDL/perl/vendor/lib/LWP/Protocol/http.pm line 50.
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
ActivePerl
|
118
|
+
|
119
|
+
Can't connect to yahoo.jp:443
|
120
|
+
|
121
|
+
Bad file descriptor at C:/Perl/site/lib/LWP/Protocol/http.pm line 46.
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
```perl
|
126
|
+
|
127
|
+
use strict;
|
128
|
+
|
129
|
+
#use Mozilla::CA;
|
130
|
+
|
131
|
+
use LWP::UserAgent;
|
132
|
+
|
133
|
+
my $ua = LWP::UserAgent->new;
|
134
|
+
|
135
|
+
#$ua->ssl_opts( verify_hostname => 0 );
|
136
|
+
|
137
|
+
# $ua->ssl_opts( SSL_ca_file => Mozilla::CA::SSL_ca_file() );
|
138
|
+
|
139
|
+
my $url;
|
140
|
+
|
141
|
+
$url = "http://yahoo.jp/";
|
142
|
+
|
143
|
+
$url = "https://yahoo.jp/";
|
144
|
+
|
145
|
+
my $res = $ua->get($url);
|
146
|
+
|
147
|
+
my $source = $res->content;
|
148
|
+
|
149
|
+
open(F,">test.html");
|
150
|
+
|
151
|
+
print F $source;
|
152
|
+
|
153
|
+
close F;
|
154
|
+
|
155
|
+
print $source;
|
156
|
+
|
157
|
+
```
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
# $ua->ssl_opts( verify_hostname => 0 );
|
20
20
|
|
21
|
-
$ua->get("http://yahoo.jp/");
|
21
|
+
$ua->get("https://yahoo.jp/");
|
22
22
|
|
23
23
|
my $source = $ua->content;
|
24
24
|
|
@@ -52,7 +52,7 @@
|
|
52
52
|
|
53
53
|
$ua->ssl_opts( verify_hostname => 0 );
|
54
54
|
|
55
|
-
$ua->get("http
|
55
|
+
$ua->get("http://yahoo.jp/");
|
56
56
|
|
57
57
|
my $source = $ua->content;
|
58
58
|
|