Tiarra + StunnelでSSL化した
iPhoneのLimechatから自分のサーバーのTiarraに接続するときに、no SSLで接続していて一切暗号化 & Man in the Middle Attack対策をしてなかったけど
まぁ普通に考えてそのへんのwifiスポットとかでそういうことやっちゃうのはかなり危険だし、社会的な死のリスクたかいのでstunnelでSSL化することにした。
$ sudo yum install stunnel $ cd /etc/pki/tls/certs; sudo make YOUR_HOSTNAME.pem $ cat /etc/stunnel/stunnel.conf cert = /etc/pki/tls/certs/YOUR_HOSTNAME.pem pid = /var/lock/stunnel.pid foreground = yes socket = l:TCP_NODELAY=1 socket = r:TCP_NODELAY=1 [ircd] accept = 6668 # SSLとして6668番ポートで受け付けて connect = localhost:6667 # localhostのTiarraの待受ポートである6667に接続する $ sudo stunnel # テストで外部からLimechatかなんかで動作チェックする # OKだったので今度は自動起動のためのスクリプト設置する. xinetdでもいいけど。 $ sudo vi /etc/init.d/stunnel # 動作テスト # 起動 $ sudo service stunnel start Starting stunnel daemon: [ OK ] # 停止 $ sudo service stunnel stop service stunnel stop Stopping stunnel daemon: [ OK ] # システム起動時に自動起動するように設定 $ sudo vi /etc/init.d/stunnel # chkconfigのためのコメントを記載する # chkconfigのリストに追加 $ sudo chkconfig --add stunnel # 確認 $ sudo chkconfig --list | grep stunnel stunnel 0:off 1:off 2:off 3:on 4:on 5:on 6:off # ランレベル3,4,5(CUIモードから、デスクトップモードまで)で自動起動してくれることを確認できた。