Skip to content

Instantly share code, notes, and snippets.

@tsaodown
Last active January 24, 2018 11:18
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsaodown/82360899d203247f459c3970a7ccf62c to your computer and use it in GitHub Desktop.
Save tsaodown/82360899d203247f459c3970a7ccf62c to your computer and use it in GitHub Desktop.
Connect weechat IRC client to slack team

Start weechat:

$ weechat

Go to the teams gateway page to retrieve your host, user, and pass

In weechat run the following:

/server add SERVER_NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK

with the following parameters:

  • USERNAME: username given from the slack account page
  • PASSWORD: password given from the slack account page
  • HOST: the team slack irc sub-domain (probably .irc.slack.com
  • NICK: your name on the slack team
  • SERVER_NAME: whatever you'd like to call the server in weechat

If you receive an error about untrusted certs like this (except with slack servers):

               │15:56:35   gitter  -- | irc: connecting to server irc.gitter.im/6667 (SSL)...
               │15:56:35   gitter  -- | gnutls: connected using 1024-bit Diffie-Hellman shared secret exchange
               │15:56:35   gitter  -- | gnutls: receiving 2 certificates
               │15:56:35   gitter  -- |  - certificate[1] info:
               │15:56:35   gitter  -- |    - subject `OU=Domain Control Validated,OU=Gandi Standard Wildcard SSL,CN=*.gitter.im', issuer `C=FR,O=GANDI SAS,CN=Gandi Standard SSL CA',
               │                      | RSA key 2048 bits, signed using RSA-SHA1, activated `2014-10-27 00:00:00 UTC', expires `2015-11-20 23:59:59 UTC', SHA-1 fingerprint
               │                      | `0f519b2d14ede0a82689ef42e328403fda5052a2'
               │15:56:35   gitter  -- |  - certificate[2] info:
               │15:56:35   gitter  -- |    - subject `C=FR,O=GANDI SAS,CN=Gandi Standard SSL CA', issuer `C=US,ST=UT,L=Salt Lake City,O=The USERTRUST
               │                      | Network,OU=http://www.usertrust.com,CN=UTN-USERFirst-Hardware', RSA key 2048 bits, signed using RSA-SHA1, activated `2008-10-23 00:00:00
               │                      | UTC', expires `2020-05-30 10:48:38 UTC', SHA-1 fingerprint `a9f79883a075ce82d20d274d1368e876140d33b3'
               │15:56:35   gitter =!= | gnutls: peer's certificate is NOT trusted
               │15:56:35   gitter =!= | gnutls: peer's certificate issuer is unknown
               │15:56:35   gitter =!= | irc: TLS handshake failed
               │15:56:35   gitter =!= | irc: error: Error in the certificate.

Take the last SHA-1 fingerprint from the request to the slack irc server and not the fingerprint of the cert of the CA.

In weechat run the following:

/set irc.server.<SERVER_NAME>.ssl_fingerprint FINGERPRINT

Now you can connect to the server with this command:

/connect <SERVER_NAME>
@beddari
Copy link

beddari commented Jun 23, 2017

If the fingerprint doesn't display for you in a proper format, use this to get it:

openssl s_client -connect <gateway_host>:6667 < /dev/null 2>/dev/null|openssl x509 -fingerprint -sha256 -noout -in /dev/stdin | tr -d \:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment