IRC (Internet Relay Chat) seems to be making a bit of a come back as of late, so I thought it was about time I made a more permanent presence, rather than just popping in via web clients from time to time.  Here's some instructions on installing WeeChat on CentOS 6 and configuring it all for Freenode using secure SSL connections and SASL authentication.

Install WeeChat

# WeeChat is available in EPEL6 (NOTE: you'll need to change this URL if you're running RHEL/CentOS 5!)
sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm  
sudo yum install weechat  
echo 'alias irc=weechat-curses' >> ~/.bashrc  
source ~/.bashrc  

Set Your Profile

I'll assume this is your first time with Freenode, so lets get connected, set up a profile and register our chosen nickname.

# Fire up WeeChat (or you could just type 'irc' if you set up the alias above)
weechat-curses

# Within WeeChat, type these commands
/set irc.server.freenode.username "{username}"
/set irc.server.freenode.realname "{enter your name here}"
/connect freenode

# Now lets choose a nick and register it
/nick <something>
/msg NickServ REGISTER password [email protected]

# You'll now receive an email to the chosen email address with a validation code
/msg NickServ VERIFY REGISTER {chosen nickname} {validation code}

Connect to Freenode using SSL

By default, WeeChat doesn't look at the right CA file, so if try to connect to Freenode using SSL, you'll find that you get the following SSL error:

rc: connecting to server chat.freenode.net/6667 (SSL)...  
22:20:40 freenode =!= | irc: TLS handshake failed  
22:20:40 freenode =!= | irc: error: A TLS packet with unexpected length was received.  

Thankfully, its quite a simple fix.

yum install ca-certificates  
$ weechat-curses
> /set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-bundle.crt"

And, now we can go ahead and configure SSL:

> /set irc.server.freenode.addresses "chat.freenode.net/7000"
> /set irc.server.freenode.ssl on
> /set irc.server.freenode.ssl_dhkey_size 1024
> /connect freenode

Authenticate with Freenode using SASL

Freenode supports the use of SASL authentication so that you don't need to identify yourself after each connection.  We can set this up with the following (obviously using your own Freenode nickname and password!):

> /set irc.server_default.sasl_mechanism dh-blowfish
> /set irc.server.freenode.nicks "{nickname}"
> /set irc.server.freenode.sasl_username "{username}"
> /set irc.server.freenode.sasl_password "{password}"