JanGe / xdcc

A wget-like utility for retrieving files from XDCC bots on IRC
MIT License
15 stars 1 forks source link

Allow self-signed certificates when connecting to network #8

Closed JanGe closed 8 years ago

JanGe commented 8 years ago

@cbm80 writes in #4:

I had alot of trouble getting the new version to work, mostly because irc-conduit (which irc-client relies on) silently fails when presented with a self-signed TLS certificate. There's no indication how, where and why it fails and it took me quite a while to figure this out.

The simplest fix turned out to be using a signed cert.

From looking at the code of irc-conduit, it actually tries to do the right thing:

-- Make the TLS certificate validation a bit more generous. In
-- particular, allow self-signed certificates.
validate cs vc sid cc = do
  -- First validate with the standard function
  res <- (onServerCertificate $ clientHooks cpara) cs vc sid cc
  -- Then strip out non-issues
  return $ filter (`notElem` [UnknownCA, SelfSigned]) res

I'll have to debug why that doesn't work as expected.

cbm80 commented 8 years ago

It does the right thing.

Using a self-signed cert failed with NoCommonName or InvalidName because I had erroneously entered bogus-data instead of the domain name when I created it. So there's nothing to debug here.

The only things that do not appear to have changed from the old version are the handling of ctrl-c and sending disconnect to ZNC prior to closing the connection.

JanGe commented 8 years ago

Alright, then I can close this issue again. ;) Thanks for the quick response!