Goguma, Caddy, and ALPN

2026-Jun-29

Users trying to connect to my IRC server with Goguma were getting this error:

HandshakeException: Handshake error in client (OS Error: TLSV1_ALERT_NO_APPLICATION_PROTOCOL(tls_record.cc:486))

I’m front-ending the IRC server with Caddy, using the layer4 module to terminate SSL/TLS and forward on to the server.

The issue appears to be that Goguma uses ALPN. Caddy is matching the ALPN request for irc, but it’s not sending back irc (I don’t exactly understand the details). There’s a good write-up at https://github.com/mholt/caddy-l4/issues/437

The fix is to have Caddy send irc back:

  layer4 {
    # SSL Proxy to IRC
    :6697 {
      # Goguma uses ALPN, so we have to do all this.
      # https://github.com/mholt/caddy-l4/issues/437
      @irc tls alpn irc
      route @irc {
        tls {
          connection_policy {
            alpn irc
          }
        }
        proxy {
          proxy_protocol v2
          upstream ircd:6667
        }
      }

      route {
        tls
        proxy {
          proxy_protocol v2
          upstream ircd:6667
        }
      }
    }
  }