LWP::UserAgentでSSL接続する場合の注意点

  • LWP::Protocol::httpsが必要

LWP::Protocol::httpsをインストールしていないと、以下のようなエラーとなります。

501 Protocol scheme 'https' is not supported (LWP::Protocol::https not installed) at ./https.pl line 15.
  • オレオレ証明書なサーバーからhttps getする場合

"verify_hostname"を使って、ホスト名の検証を無視します。

LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 });