SSL.txt 3.5 KB

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