To create new wiki account, please join us on #znc at Libera.Chat and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Cert: Difference between revisions

From ZNC
Jump to navigation Jump to search
>Paccer
No edit summary
Zarthus (talk | contribs)
Add caveats and generify the result.
(18 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Core Module}}
{{Core Module}}


This module lets users use their own SSL certificate to connect to a server, such as [http://www.oftc.net/oftc/NickServ/CertFP CertFP].  
This module lets users use their own SSL certificate to connect to a server, such as [https://www.oftc.net/NickServ/CertFP/ CertFP].  


You will have to generate a SSL certificate to use with this module and either place it at `~/.znc/users/<user>/moddata/cert/user.pem` or use the web admin to upload the certificate.
You will have to generate an SSL certificate to use with this module. Either place it at `~/.znc/users/<user>/networks/<network>/moddata/cert/user.pem`, or use the web interface to upload the certificate.


{{Module arguments|type=test}}
You can usually test if Cert is supported by services simply by sending <code>/msg NickServ cert</code>. If you get an error about “Insufficient parameters for CERT,” CertFP is supported. If you get an error about unknown command, or no response at all, it may not supported. While this is a fairly reliable test, it may vary by IRC network, for example [http://rizon.net Rizon] supports Cert but uses the command <code>/msg NickServ access</code> instead.
 
{{Module arguments|type=user/network}}


===Commands===
===Commands===
Line 17: Line 19:
+---------+-----------+--------------------------------+
+---------+-----------+--------------------------------+
</pre>
</pre>
==Generating a certificate ==
==Generating a certificate ==
You can use the following openssl commands to generate a certificate
This command would produce a 2048-bit certificate which would expire in 3650 days. You can modify the arguments to openssl to change this. user.pem is the certificate you will need to add to ZNC.
<pre>openssl req -nodes -newkey rsa:2048 -keyout user.pem -x509 -days 3650 -out user.pem -subj "/CN=YourNickname"</pre>
''If you are following instructions from [[certauth]], you can stop here. Your certificate is <code>user.pem</code>, and [https://freenode.net/kb/answer/certfp you must tell your client to use it.]''
==Utilizing the certificate==
This part of the article is written generically, and the instructions might differ from network to network dependent on a myriad of variables. If something doesn't work, consult your network's website and support venues.
To get a SHA-1 fingerprint, enter the following command:
openssl x509 -sha1 -noout -fingerprint -in user.pem | sed -e 's/^.*=//;s/://g;y/ABCDEF/abcdef/'
''note: Not all networks use sha-1 fingerprints, consult the network you're connecting to for this information.''


You can use the following openssl commands to generate a certificate  
Add the fingerprint to your NickServ account:
<code>openssl req -nodes -newkey rsa:2048 -keyout znc.key -x509 -days 365 -out znc.crt
/msg NickServ cert add ''fingerprint''
cat znc.crt znc.key > znc.pem</code>
''note: some services support adding fingerprint if you're connected with a certificate, and <code>/msg NickServ cert add</code> alone will work. It is also often possible to WHOIS yourself for the fingerprint.''


This command would produce a 2048-bit certificate which would expire in 356 days. You can modify the arguments to openssl to change this. znc.pem is the certificate you will need to add to ZNC.
Now move the cert your folder:
mv user.pem ~/.znc/users/<user>/networks/<network>/moddata/cert/

Revision as of 11:53, 2 April 2018


This module lets users use their own SSL certificate to connect to a server, such as CertFP.

You will have to generate an SSL certificate to use with this module. Either place it at `~/.znc/users/<user>/networks/<network>/moddata/cert/user.pem`, or use the web interface to upload the certificate.

You can usually test if Cert is supported by services simply by sending /msg NickServ cert. If you get an error about “Insufficient parameters for CERT,” CertFP is supported. If you get an error about unknown command, or no response at all, it may not supported. While this is a fairly reliable test, it may vary by IRC network, for example Rizon supports Cert but uses the command /msg NickServ access instead.

Arguments

This user/network module takes no arguments.

Read loading modules to learn more about loading modules.

Commands

+---------+-----------+--------------------------------+
| Command | Arguments | Description                    |
+---------+-----------+--------------------------------+
| Help    |           | Generate this output           |
| delete  |           | Delete the current certificate |
| info    |           |                                |
+---------+-----------+--------------------------------+

Generating a certificate

You can use the following openssl commands to generate a certificate

This command would produce a 2048-bit certificate which would expire in 3650 days. You can modify the arguments to openssl to change this. user.pem is the certificate you will need to add to ZNC.

openssl req -nodes -newkey rsa:2048 -keyout user.pem -x509 -days 3650 -out user.pem -subj "/CN=YourNickname"

If you are following instructions from certauth, you can stop here. Your certificate is user.pem, and you must tell your client to use it.

Utilizing the certificate

This part of the article is written generically, and the instructions might differ from network to network dependent on a myriad of variables. If something doesn't work, consult your network's website and support venues.

To get a SHA-1 fingerprint, enter the following command:

openssl x509 -sha1 -noout -fingerprint -in user.pem | sed -e 's/^.*=//;s/://g;y/ABCDEF/abcdef/'

note: Not all networks use sha-1 fingerprints, consult the network you're connecting to for this information.

Add the fingerprint to your NickServ account:

/msg NickServ cert add fingerprint

note: some services support adding fingerprint if you're connected with a certificate, and /msg NickServ cert add alone will work. It is also often possible to WHOIS yourself for the fingerprint.

Now move the cert your folder:

mv user.pem ~/.znc/users/<user>/networks/<network>/moddata/cert/