ngircdをSSLで使う

Arch Linuxでコンパイル
では、IPv6を使えるようにしました。
が、ついでにSSLにも対応させようと思います。

http://ngircd.barton.de/doc/SSL.txt

configureオプション
–with-openssl=/bin/openssl
これを追記してやるだけ。


実際には

# vim PKGBUILD
 
build() {
        cd $srcdir/$pkgname-$pkgver
        ./configure --prefix=/usr \
                --sysconfdir=/etc \
                --mandir=/usr/share/man \
                --with-ident \
                --enable-ipv6 \
                --with-openssl=/bin/openssl

あとは、コンパイルなどしてあげればOK。

さて、インストールが終わった所で、
オレオレ証明書と鍵を作ってあげます

# mkdir /etc/ngircd
# openssl req -newkey rsa:2048 -x509 -keyout server-key.pem -out server-cert.pem -days 14610
# openssl dhparam -2 -out dhparams.pem 4096
# mv server-key.pem server-cert.pem dhparams.pem /etc/ngircd

(dhparams.pemは別になくてもOK・・すごい時間かかるw)

設定を変更します。

# vim /etc/ngircd.conf
[SSL]
        # SSL-related configuration options. Please note that this section
        # is only available when ngIRCd is compiled with support for SSL!
        # So don't forget to remove the ";" above if this is the case ...

        # SSL Server Key Certificate
        CertFile = /etc/ngircd/server-cert.pem

        # Diffie-Hellman parameters
        DHFile = /etc/ngircd/dhparams.pem

        # SSL Server Key
        KeyFile = /etc/ngircd/server-key.pem

        # password to decrypt SSLKeyFile (OpenSSL only)
        KeyFilePassword = passwd

        # Additional Listen Ports that expect SSL/TLS encrypted connections
        Ports = 6697, 9999

こんな感じです。

IRCクライアントで接続した際

- irc.neko6.info message of the day
- Connected using Cipher AES128-SHA SSLv3 Kx=RSA Au=RSA Enc=AES(128) Mac=SHA1
End of MOTD command

と表示されればOK

ちなみに
GlobalセクションのPortsの設定をすると、
SSLを使った接続と両方出来ます

[Global]

Ports = 6667

no SSL
irc.neko6.info:6667
#サーバー管理室

with SSL
irc.neko6.info:9999
#サーバー管理室

よろしくお願いします。

[tegaki]使ってあげて〜〜w[/tegaki]

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

Enter code * Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.