]> jfr.im git - irc/freenode/web-7.0.git/blame - content/kb/using/certfp.md
Add instructions for setting modes
[irc/freenode/web-7.0.git] / content / kb / using / certfp.md
CommitLineData
c3260969
EK
1---
2Title: CertFP
3Slug: certfp
4---
5
6As an alternative to password-based authentication, you can connect to freenode
7with a TLS certificate and have services recognise it automatically.
8
fe904693
DP
9For SASL EXTERNAL to work, you must connect over SSL.
10
c3260969
EK
11Creating a self-signed certificate
12==================================
13
14In order to follow these instructions, you will need the `openssl` utility. If
15you are using Windows and do not have a copy, you might consider using Cygwin.
16
17You can generate a certificate with the following command:
18
52b1f108 19 openssl req -x509 -new -newkey rsa:4096 -sha256 -days 1000 -nodes -out freenode.pem -keyout freenode.pem
c3260969
EK
20
21You will be prompted for various pieces of information about the certificate.
22The contents do not matter for our purposes, but `openssl` needs at least one of
23them to be non-empty.
24
25The `.pem` file will have the same access to your NickServ account as your
26password does, so take appropriate care in securing it.
27
28Under Unix-like environments, the following command:
29
30 openssl x509 -in freenode.pem -outform der | sha1sum -b | cut -d' ' -f1
31
32will list the certificate fingerprint.
33
34
35Connecting to freenode with your certificate
36============================================
37
38IRC clients generally differ in where they look for a certificate and how you
39configure them to offer it to the server. If yours is not yet listed here,
40advice in this section is unlikely to apply, but guides may be available
41elsewhere on the web.
42
43irssi
44-----
45
46Move the certificates you created above to ~/.irssi/certs
47
48 mkdir ~/.irssi/certs
49 mv freenode.pem ~/.irssi/certs
50
51Now configure your `/server` entry for freenode to use this certificate. You
52may need to adapt this example for your existing configuration (the network
53and hostname should match what you already use).
54
55 /server add -auto -ssl -ssl_cert ~/.irssi/certs/freenode.pem -network freenode chat.freenode.net 6697
56
57weechat
58-------
59
60Move the certificates you created above to ~/.weechat/certs
61
62 mkdir ~/.weechat/certs
a738a77e 63 mv freenode.pem ~/.weechat/certs
c3260969
EK
64
65Now disconnect and remove the current freenode server(s). Re-add it with the
66SSL flag, using your newly generated certificate. Note that these commands are
67just examples, you have to adapt them to your current servers.
68
69 /set irc.server.freenode.addresses chat.freenode.net/6697
70 /set irc.server.freenode.ssl on
71 /set irc.server.freenode.ssl_verify on
a738a77e 72 /set irc.server.freenode.ssl_cert %h/certs/freenode.pem
c3260969
EK
73 /set irc.server.freenode.sasl_mechanism external
74
75and then reconnect to freenode.
76
77znc
78---
79
80Refer to znc's [official documentation](http://wiki.znc.in/Cert).
81
47a5da6e 82HexChat
83-------
84
b58d62b7
EK
85The pem file should be placed in `certs/network name.pem` in the HexChat config
86directory (`~/.config/hexchat/` or `%appdata%\HexChat`), where `network name`
87is the name of the network as it appears in the network list (Ctrl-S). Note
88that the `certs` directory does not exist by default and you will have to
89create it yourself. Once the file is there, all subsequent SSL connections to
90that network will use the certificate.
47a5da6e 91
dab38ee0
CFL
92Konversation
93------------
94
95Create the pem file as per above, then place it wherever you want.
96Start Konversation, then open the Identity dialogue by either pressing F8
97or via the Settings menu entry. Choose the identity you use for the
98freenode network or create a new one.
99In the part `Auto Identity` you have to choose `SASL External (Cert)`
100as the `Type` for SASL External or `SSL CLient Certificate` for CertFP.
101SASL External requires at least version 1.7 of Konversation.
102Optionally fill in your account name in the `Account`field.
103You can then choose the certificate you created with the file picker
104or enter the path manually in the field next to it.
105Once done, apply the configuration and (re)connect to freenode.
c3260969
EK
106
107Add your fingerprint to NickServ
108================================
109
110You can then check whether you have a fingerprint by using `whois` on yourself:
111
112 /whois YourOwnNick
113 ...
114 YourOwnNick has client certificate fingerprint f3a1aad46ca88e180c25c9c7021a4b3a
115 ...
116
117To allow NickServ to recognise you based on your certificate, you need to add
118the fingerprint to your account (you will need to log in by other means in order
119to do so).
120
121You can then authorise your current certificate fingerprint:
122
123 /msg NickServ CERT ADD
124
125In the future, any connections you make to freenode with your certificate will
126be logged into your account automatically. Optionally, or if you wish to connect
127via Tor, you can enable SASL with the `EXTERNAL` mechanism.