LoginSignup
2
2

More than 3 years have passed since last update.

PerlでHTTPS通信がうまくいかないときの対処方 on Ubuntu

Posted at

Perlでhttpsへの通信をやろうとして失敗したときの対処メモ。

環境

  • Ubuntu 18.04.2 LTS
  • perl 5.28.2

今回はAnyEvent::HTTPを使って非同期通信をしようとした。
初期状態で通信を実施すると、httpステータスコード596で、「TLS support not available on this system」となる。

Perlでhttpsをサポートするには下記のモジュールを入れるが、Net::SSLeyがインストールできずに失敗した。

console
cpanm Net::SSLeay
cpanm Crypt::SSLeay
cpanm IO::Socket::SSL

ログを確認すると、「/usr/bin/ld: -lz が存在しません。」とある。なので、下記をインストールすることで上記モジュールもインストールでき、https通信を行うことができた。

console
sudo apt-get install zlib1g
sudo apt-get install zlib1g-dev 

zlib は gzip と PKZIP で使われている deflate 圧縮法を実装したライブラリ、らしい。
自分の環境では、zlib1g-devのほうがOSにインストールされてなかったので、追加でインストールした形になる。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2