Add irc to ALPN protocols

The new ALPN token has been approved [1]. We can start using it now.

[1]: https://mailarchive.ietf.org/arch/msg/tls-reg-review/i8YyT82XUtEgR-oXMG3sbyWYT8E/
This commit is contained in:
Simon Ser 2021-02-24 19:41:12 +01:00
parent 6a1a05b1d4
commit 0954c7da79
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
2 changed files with 5 additions and 2 deletions

View File

@ -55,7 +55,10 @@ func main() {
if err != nil { if err != nil {
log.Fatalf("failed to load TLS certificate and key: %v", err) log.Fatalf("failed to load TLS certificate and key: %v", err)
} }
tlsCfg = &tls.Config{Certificates: []tls.Certificate{cert}} tlsCfg = &tls.Config{
NextProtos: []string{"irc"},
Certificates: []tls.Certificate{cert},
}
} }
srv := soju.NewServer(db) srv := soju.NewServer(db)

View File

@ -132,7 +132,7 @@ func connectToUpstream(network *network) (*upstreamConn, error) {
logger.Printf("connecting to TLS server at address %q", addr) logger.Printf("connecting to TLS server at address %q", addr)
tlsConfig := &tls.Config{ServerName: host} tlsConfig := &tls.Config{ServerName: host, NextProtos: []string{"irc"}}
if network.SASL.Mechanism == "EXTERNAL" { if network.SASL.Mechanism == "EXTERNAL" {
if network.SASL.External.CertBlob == nil { if network.SASL.External.CertBlob == nil {
return nil, fmt.Errorf("missing certificate for authentication") return nil, fmt.Errorf("missing certificate for authentication")