24 10 2005 Tweet
CurlではOKだけどWgetはプロキシーが超えられないという謎の挙動は、結局解決しなかった。500番(Internal Server Error)でSSLの接続ができないというエラーなのはわかったが。
Some added "magic" is apparently needed since rhnlib is able to go through it but urllib isn't. Actually the same problem happens with wget vs curl: curl is able to go through the proxy with https, wget isn't, with the same exact proxy config. Any ideas?
色々調べたけど、そういうものっぽいのか?
というわけで、WWW::Curlを入れてみた。
make testのあたりが素直でないので、perl -MCPANでなくて、普通にmake test無しでいれた。force installでも良かったのかな
#!/usr/bin/perl use strict; use WWW::Curl::Easy; my $url = 'https://www.google.com/adsense/'; my $curl = new WWW::Curl::Easy; $curl->setopt(CURLOPT_URL,$url); #$curl->setopt(CURLOPT_SSL_VERIFYHOST,0); #$curl->setopt(CURLOPT_SSL_VERIFYPEER,0); my $code = $curl->perform;
認証周りで悩んだときはCURLOPT_SSL*をつけておけばいい。ちょっと使ってみた感じではやっぱCURLOPT_周りがわかりにくいのと、やっぱWWW::Mechanize使いたかったなぁってこと。