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.


From ZNC
Revision as of 01:19, 23 December 2021 by Eletrotupi (talk | contribs) (→‎Connecting)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Connecting to ZNC[edit]



Connections to ZNC using SSL:

Note that the irc.server.BNC.ssl_fingerprint should only be used if you're NOT using a Signed Certificate.. If you're using a certificate generated with, let's say Let'sEncrypt, you can safely just add the network and you're done.

 /server add BNC -ssl -username=username/network -password=password -autoconnect
 /set irc.server.BNC.ssl_fingerprint MD5_or_SHA256_or_SHA512_fingerprint_here
 /connect BNC
Getting the SSL fingerprint[edit]

WeeChat 0.4.3 wants md5 (insecure, deprecated) fingerprint (replace -sha512 with -md5 below or better, upgrade), WeeChat 1.2 allows sha256 and sha512.

Note: This is only necessary if you are not using a Signed SSL Certificate, i.e. if you're using a self-signed certificate.

cat ~/.znc/znc.pem | openssl x509 -sha512 -fingerprint -noout | tr -d ':' | tr 'A-Z' 'a-z' | cut -d = -f 2


It does not connect.

If port 6697 is the SSL port, you need to specify that it's SSL port with /set irc.server.BNC.ssl on

This is a failed attempt due to not specifying the "irc.server.BNC.ssl on" or "-ssl"

  05:46:47     BNC =!= | irc: connection refused
  05:46:47     BNC  -- | irc: reconnecting to server in 10 seconds
  05:46:57     BNC  -- | irc: reconnecting to server...
  05:46:57     BNC  -- | irc: connecting to server (SSL)...
  05:46:58     BNC =!= | irc: connection refused

Non SSL[edit]

This is for plain non-ssl connections.

 /server add BNC -username=username/network -password=password -autoconnect
 /connect BNC

Specifying username/network:password later[edit]

 /set irc.server.bnc.username username/network
 /set irc.server.bnc.password password

Tips & Tricks[edit]

Enabling server-time & other IRCv3 capabilities[edit]

WeeChat by default requests no IRCv3 capability from the server acting as not-IRCv3 capable client. This can be fixed with the following commands on WeeChat 0.3.7+:

/set irc.server_default.capabilities account-notify,away-notify,cap-notify,multi-prefix,server-time,,
/reconnect -all

You must reconnect for this to take effect. This list is "safe capabilities" (see the issue on top of this section) that are supported by WeeChat.

  • account-notify (WeeChat 1.2+) makes the server inform when people login/logout or switch account. Requires cap-notify
  • away-notify (WeeChat 1.1+) makes the server inform when people go away or come back eliminating the need of who-polling. Requires cap-notify
  • cap-notify (WeeChat 1.4+) makes the server inform when capabilities come available or disappear. ZNC requires this from client for some capabilities as it cannot know what capabilities the server supports before it's connected and when ZNC gets disconnected from server the capabilities aren't supported anymore.
  • multi-prefix (WeeChat 0.0.1+) makes the server tell you all prefixes (@+) in case users have multiple prefixes on channel. Without multi-prefix the server only tells the highest prefix and ZNC strips the other prefixes from commands.
  • server-time (WeeChat 0.4.0+) ( before 1.7.0) makes ZNC send buffer playbacks without it's own timestamp (12:00:00 <nick> [00:00:00] blah becomes 00:00:00 <nick> blah).
  • (WeeChat 0.3.0+) makes ZNC show PMs you have sent in query buffer playback.

For all capabilities supported by WeeChat, see /help cap (WeeChat 1.4+) or /help irc.server_default.capabilities (WeeChat 1.3 & older).

Disabling automatic switching of buffer[edit]

When you connect WeeChat to ZNC, your channels change a lot until you are joined everywhere. This can be disabled with the following commands:

 /set irc.look.buffer_switch_autojoin off
 /set irc.look.buffer_switch_join off

Enabling /ZNC and other raw commands[edit]

WeeChat doesn't send unknown commands to server by default in fear of accidentally sending passwords or other sensitive content. You can disable this with

/set on

Alternatively you can create Alias

/alias add znc /quote znc

Disabling charset plugin[edit]

ZNC (when compiled with libicu) has the option to do charset conversions. WeeChat does this by default too, but it's easy to disable

/plugin unload charset
/set weechat.plugin.autoload *,!charset