Debianでngircd

パッケージから入れたら、SSLが使えない。。。
多分、Ubuntuでもダメだと思う。。。

クライアントから接続すると、
Connecting…
Connected
The operation couldn’t be completed. (kCFStreamErrorDomainSSL error -9844.)
Disconnected
Reconnecting…

以下ループ。。。

SSLは使えるように見えるけど。。

# ngircd -V
ngircd 15-SYSLOG+ZLIB+SSL+IRCPLUS+IPv6-x86_64/pc/linux-gnu
Copyright (c)2001-2009 Alexander Barton (<alex@barton.de>) and Contributors.
Homepage: <http://ngircd.barton.de/>

This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

OS・・・Debian Squeeze
ngircd・・・ngircd 15-0.1

SSLを使わなきゃいいんですが、
やってみたくなるのが人情。。。

*******追記(解決)*******

どうやら、Debianでは鍵等を作るときに
OpenSSLを使わず、GunTLSを使えばいいみたいです。

# aptitude install gnutls-bin
# certtool --generate-privkey --bits 2048 --outfile server-key.pem
# certtool --generate-self-signed --load-privkey server-key.pem --outfile server-cert.pem
# certtool  --generate-dh-params --bits 4096 --outfile dhparams.pem

Ubuntuでも同様にすればいけるはずw


入ってたら削除してしまおう

# apt-get purge ngircd

purgeだとconfも全部アンインストールしてくれます。

さて、パッケージソースから作ってみましょ

# mkdir /usr/local/src/ngircd
# cd /usr/local/src/ngircd
# apt-get source ngircd
# ls
ngircd-15  ngircd_15-0.1.diff.gz  ngircd_15-0.1.dsc  ngircd_15.orig.tar.gz

# cd ngircd-15

準備完了〜

・Configureオプション

—with-openssl・・・追記
—with-gnutls・・・削除
–enable-ipv6・・・使わないなら削除してもいいです

# vi vi debian/rules

./configure --with-openssl --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc/ngircd --without-epoll --enable-ipv6

こんな感じ。
どうやらデフォルトだとgnutlsを使うようになってるみたい。
で、どうやら排他的らしく–with-opensslを追記するだけだと、

configure: error: Cannot enable both gnutls and openssl
make: *** [config.status] Error 1
dpkg-buildpackage: error: debian/rules build gave error exit status 2

となります。

で、パッケージの作成

# dpkg-buildpackage
# cd ..
# ls
ngircd-15		     ngircd_15-0.1_amd64.deb  ngircd_15-0.1.dsc
ngircd_15-0.1_amd64.changes  ngircd_15-0.1.diff.gz    ngircd_15.orig.tar.gz

# dpkg -i ngircd_15-0.1_amd64.deb

dpkg-buildpackageでエラーが出たら

dpkg-checkbuilddeps: Unmet build dependencies: autotools-dev dpatch
dpkg-buildpackage: warning: Build dependencies/conflicts unsatisfied; aborting.
dpkg-buildpackage: warning: (Use -d flag to override.)

お望み通り入れてあげましょうw

# apt-get install autotools-dev dpatch

鍵等をつくりましょ

# 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

どうやら、[SSL]セクションが無いので、
(ngIRCd 18~rc1以降で[SSL]が使える)
http://ngircd.barton.de/doc/ChangeLog

# vi /etc/ngircd/ngircd.conf
[Global]

  SSLPorts = 9999
  SSLKeyFile = /etc/ngircd/server-key.pem
  SSLCertFile = /etc/ngircd/server-cert.pem
  SSLDHFile = /etc/ngircd/dhparams.pem
  SSLKeyFilePassword = 鍵を作ったときに入れたパスワード

を追記します。
これで、SSLを使った通信が出来るようになります。

作ったパッケージ

# ngircd -V
ngircd 15-SYSLOG+ZLIB+SSL+IRCPLUS+IPv6-x86_64/pc/linux-gnu
Copyright (c)2001-2009 Alexander Barton (<alex@barton.de>) and Contributors.
Homepage: <http://ngircd.barton.de/>

This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

変わってないような。。。

[tegaki]リンクしようよぉ〜[/tegaki]

Debianでngircd” に1件のフィードバックがあります

  1. イニュイト

    configure: error: Cannot enable both gnutls and openssl
    make: *** [config.status] Error 1
    dpkg-buildpackage: error: debian/rules build gave error exit status 2
    のエラーは
    apt-get install libssl-dev
    だけでOKよぉw

    返信

コメントを残す

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

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

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください