ssl.txt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. SERVER CONFIGURATION
  2. --------------------
  3. No changes are made to tintin or script configuration. The plan is to tunnel
  4. an SSL connection to your #port or #chat port.
  5. One problem is that redirected connections will appear to originate from
  6. localhost. Fortunately tintin can handle this if needed.
  7. You'll need to install the 'stunnel' package or download it from the
  8. www.stunnel.org website. There is a Windows version of stunnel with
  9. essentially the same interface.
  10. You'll also need the 'openssl' package.
  11. If you do this on Ubuntu the package might install the command as stunnel4
  12. while stunnel calls stunnel3. Be mindful of that.
  13. Create a directory to store the certificates, and the stunnel config file.
  14. Create a self-signed certificate using openssl. For more info see:
  15. http://www.stunnel.org/faq/certs.html
  16. Switch to the directory where you want to store the certs, and then run the
  17. command to generate a self-signed cert:
  18. openssl req -new -x509 -days 3650 -nodes -out stunnel.pem -keyout stunnel.pem
  19. It will prompt you for some information. The only thing you really need to
  20. change from default, is the Common Name entry, which you should specify the
  21. full hostname of your server, for example: server.domain.com
  22. Do not enter a passphrase for the cert, otherwise you will be prompted to
  23. enter this passphrase every single time you start stunnel.
  24. Run chmod 660 stunnel.pem
  25. Stunnel will fail if the permissions are not correct on the file.
  26. Create the config file for stunnel4, for example tinssl.conf, and use the
  27. following contents, adjusting where necessary:
  28. Code: [Select]
  29. foreground = no
  30. pid=/home/user/.tintin/ssl/tinssl.pid
  31. [tinssl]
  32. accept=4051
  33. cert=/home/user/.tintin/ssl/stunnel.pem
  34. key=/home/user/.tintin/ssl/stunnel.pem
  35. client=no
  36. connect=localhost:4050
  37. The foreground option - change this to 'yes' to keep stunnel in the foreground
  38. initially. Useful to see errors. Specify the pid to a writable path, or set it
  39. to "pid=" for no pid file. If you don't know what a pid file is you can leave
  40. it blank.
  41. The segment headed by [tinssl] is the service entry. The name is arbitrary,
  42. and there can be multiple entries if you want more tunnels. "accept=4051" is
  43. the port for stunnel to listen for connections. "client=no" is software
  44. default - this specifies a server connection, so stunnel must listen on 4051
  45. for SSL connections. "connect=localhost:4050" This specifies where stunnel
  46. will direct the incoming SSL connection. In this case, to tintin's default
  47. chat port.
  48. Now run: stunnel4 tinssl.conf
  49. It should disappear into the background, or if you set foreground=yes, you
  50. will see the basic log.
  51. Run "ps -aux|grep stunnel" to verify that stunnel is running. There will
  52. probably be around 4 processes running (For some odd reason). For
  53. Windows, you should have an icon in the system tray.
  54. With tintin you can now connect to the port using the #ssl command. To
  55. connect to a chat port you'd have to run the connection through another
  56. stunnel proxy. If there are problems check the logs and verify you opened
  57. the port on your firewall, etc.
  58. CLIENT CONFIGURATION
  59. --------------------
  60. If you want to use an SSL connection over #chat you can set up stunnel in
  61. client mode to connect to your new SSL proxy. In this case we'll use
  62. Windows, but it's virtually identical on any supported platform.
  63. Install stunnel for Windows.
  64. Edit the stunnel config from the convenient menu entry. Leave everything as
  65. is, and add a service entry at the bottom of the file:
  66. Code: [Select]
  67. [tinssl]
  68. accept = 12345
  69. connect = server.domain.com:4051
  70. client = yes
  71. "accept=12345" is the LOCAL port for stunnel to listen on.
  72. "connect=server.domain.com:4051" is the SSL server to connect to, in this
  73. case, your newly configured stunnel on your host server.
  74. "client=yes" This is important, stunnel will NOT work properly if you do not
  75. set client=yes here.
  76. Run stunnel, and you will get a new icon in your systray. You can right-click
  77. it and 'View Log' to see what's going on, if you like. Run tintin and create
  78. a chat connection to localhost, port 12345 (or whatever you configured).
  79. You should be momentarily connected to the given ssl server.
  80. Special thanks to Vilentus for the original documentation.