Skip to content

Instantly share code, notes, and snippets.

@ComputerTech312
Created January 8, 2023 16:55
Show Gist options
  • Save ComputerTech312/caa8b05eb535ec497b5c12401a4d9443 to your computer and use it in GitHub Desktop.
Save ComputerTech312/caa8b05eb535ec497b5c12401a4d9443 to your computer and use it in GitHub Desktop.

Use the following command to generate a ssl key and change "YourNickname" to your ZNC username, use this command in your home directory:

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

Now we're going to use the following command to find out what our ssl fingerprint is, so we can copy and use that for later on for another command:

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

And now from IRC, we're going to use the following command to load the module globally for your current user, NOTE: there is no need to change the variable: "$user" and that variable simply means the current user you're logged in with.

/msg *controlpanel loadmodule $user cert

Then use the following command to move the "user.pem" file to the correct directory for the znc:

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

To check if the certificate is correctly set/ready, use the following command:

/msg *cert info

and the response from above command should be something like this:

<*cert> You have a certificate in /home/computertech/.znc/users/YourNickname/moddata/cert/user.pem

Assuming the services you're using is Nickserv, we're going to use this command, to add your fingerprint, so you'll automatically be identified when you connect upcoming times. Note: replace "fingerprint" with the fingerprint you copied earlier.

/msg NickServ cert add fingerprint

And finally we're going to use the following command to jump your znc from the current network, so it may use the cert, or you can simply reboot your znc for affect on all networks:

Reboot: /znc reboot    Jump: /znc jump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment