]> arthur.barton.de Git - ngircd-alex.git/blob - doc/SSL.txt
doc/SSL.txt: enhance documentation.
[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 need a SSL certificate, see below for how to create a self-signed one.
24
25
26 Configuration
27 ~~~~~~~~~~~~~
28
29 To enable SSL connections a separate port must be configured: it is NOT
30 possible to handle unencrypted and encrypted connections on the same port!
31 This is a limitation of the IRC protocol ...
32
33 You have to set (at least) the following configuration variables in the
34 [GLOBAL] section of ngircd.conf(5): SSLPorts, SSLKeyFile, and SSLCertFile.
35
36 Now IRC clients are able to connect using SSL on the configured port(s).
37 (Using port 6697 for encrypted connections is common.)
38
39 To enable encrypted server-server links, you have to additionally set
40 SSLConnect to "yes" in the corresponding [SERVER] section.
41
42
43 Creating a self-signed certificate
44 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45
46 OpenSSL:
47
48 Creating a self-signed certificate and key:
49  $ openssl req -newkey rsa:2048 -x509 -keyout server-key.pem \
50         -out server-cert.pem -days 1461
51 Create DH parameters (optional):
52  $ openssl dhparam -2 -out dhparams.pem 2048
53
54 GnuTLS:
55
56 Creating a self-signed certificate and key:
57  $ certtool --generate-privkey --bits 2048 --outfile server-key.pem
58  $ certtool --generate-self-signed --load-privkey server-key.pem \
59          --outfile server-cert.pem
60 Create DH parameters (optional):
61  $ certtool  --generate-dh-params --bits 2048 --outfile dhparams.pem
62
63
64 Alternate approach using stunnel(1)
65 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66
67 Alternatively (or if you are using ngIRCd without compiled without support
68 for GnuTLS/OpenSSL), you can use external programs/tools like stunnel(1) to
69 get SSL encrypted connections:
70
71   <http://stunnel.mirt.net/>
72   <http://www.stunnel.org/>
73
74 Stefan Sperling (stefan at binarchy dot net) mailed the following text as a
75 short "how-to", thanks Stefan!
76
77 === snip ===
78     ! This guide applies to stunnel 4.x !
79
80     Put this in your stunnel.conf:
81
82         [ircs]
83         accept = 6667
84         connect = 6668
85
86     This makes stunnel listen for incoming connections
87     on port 6667 and forward decrypted data to port 6668.
88     We call the connection 'ircs'. Stunnel will use this
89     name when logging connection attempts via syslog.
90     You can also use the name in /etc/hosts.{allow,deny}
91     if you run tcp-wrappers.
92
93     To make sure ngircd is listening on the port where
94     the decrypted data arrives, set
95
96         Ports = 6668
97
98     in your ngircd.conf.
99
100     Start stunnel and restart ngircd.
101
102     That's it.
103     Don't forget to activate ssl support in your irc client ;)
104 === snip ===