]> arthur.barton.de Git - ngircd-alex.git/blob - doc/SSL.txt
Mac OS X: fix test for packagemaker(1) tool in Makefile
[ngircd-alex.git] / doc / SSL.txt
1
2                      ngIRCd - Next Generation IRC Server
3
4                         (c)2001-2008 Alexander Barton,
5                     alex@barton.de, http://www.barton.de/
6
7                ngIRCd is free software and published under the
8                    terms of the GNU General Public License.
9
10                                  -- SSL.txt --
11
12
13 ngIRCd supports SSL/TLSv1 encrypted connections using the OpenSSL or GnuTLS
14 libraries. Both encrypted server-server links as well as client-server links
15 are supported.
16
17 SSL is a compile-time option which is disabled by default. Use one of these
18 options of the ./configure script to enable it:
19
20   --with-openssl     enable SSL support using OpenSSL
21   --with-gnutls      enable SSL support using GnuTLS
22
23 You also need a key/certificate, see below for how to create a self-signed one.
24
25 From a feature point of view, ngIRCds support for both libraries is
26 comparable. The only major difference (at this time) is that ngircd with gnutls
27 does not support password protected private keys.
28
29 Configuration
30 ~~~~~~~~~~~~~
31
32 To enable SSL connections a separate port must be configured: it is NOT
33 possible to handle unencrypted and encrypted connections on the same port!
34 This is a limitation of the IRC protocol ...
35
36 You have to set (at least) the following configuration variables in the
37 [GLOBAL] section of ngircd.conf(5): SSLPorts, SSLKeyFile, and SSLCertFile.
38
39 Now IRC clients are able to connect using SSL on the configured port(s).
40 (Using port 6697 for encrypted connections is common.)
41
42 To enable encrypted server-server links, you have to additionally set
43 SSLConnect to "yes" in the corresponding [SERVER] section.
44
45
46 Creating a self-signed certificate
47 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48
49 OpenSSL:
50
51 Creating a self-signed certificate and key:
52  $ openssl req -newkey rsa:2048 -x509 -keyout server-key.pem \
53         -out server-cert.pem -days 1461
54 Create DH parameters (optional):
55  $ openssl dhparam -2 -out dhparams.pem 2048
56
57 GnuTLS:
58
59 Creating a self-signed certificate and key:
60  $ certtool --generate-privkey --bits 2048 --outfile server-key.pem
61  $ certtool --generate-self-signed --load-privkey server-key.pem \
62          --outfile server-cert.pem
63 Create DH parameters (optional):
64  $ certtool  --generate-dh-params --bits 2048 --outfile dhparams.pem
65
66
67 Alternate approach using stunnel(1)
68 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69
70 Alternatively (or if you are using ngIRCd compiled without support
71 for GnuTLS/OpenSSL), you can use external programs/tools like stunnel(1) to
72 get SSL encrypted connections:
73
74   <http://stunnel.mirt.net/>
75   <http://www.stunnel.org/>
76
77 Stefan Sperling (stefan at binarchy dot net) mailed the following text as a
78 short "how-to", thanks Stefan!
79
80 === snip ===
81     ! This guide applies to stunnel 4.x !
82
83     Put this in your stunnel.conf:
84
85         [ircs]
86         accept = 6667
87         connect = 6668
88
89     This makes stunnel listen for incoming connections
90     on port 6667 and forward decrypted data to port 6668.
91     We call the connection 'ircs'. Stunnel will use this
92     name when logging connection attempts via syslog.
93     You can also use the name in /etc/hosts.{allow,deny}
94     if you run tcp-wrappers.
95
96     To make sure ngircd is listening on the port where
97     the decrypted data arrives, set
98
99         Ports = 6668
100
101     in your ngircd.conf.
102
103     Start stunnel and restart ngircd.
104
105     That's it.
106     Don't forget to activate ssl support in your irc client ;)
107     The main drawback of this approach compared to using builtin ssl
108     is that from ngIRCds point of view, all ssl-enabled client connections will
109     originate from the host running stunnel.
110 === snip ===