Skip to content

Commit

Permalink
Don't send a TLS ALPN name
Browse files Browse the repository at this point in the history
  • Loading branch information
neilalexander committed Oct 14, 2023
1 parent 117e4b8 commit efb4b46
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/core/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package core
import (
"crypto/tls"
"crypto/x509"
"fmt"
)

func (c *Core) generateTLSConfig(cert *tls.Certificate) (*tls.Config, error) {
Expand All @@ -17,32 +16,14 @@ func (c *Core) generateTLSConfig(cert *tls.Certificate) (*tls.Config, error) {
VerifyConnection: c.verifyTLSConnection,
InsecureSkipVerify: true,
MinVersion: tls.VersionTLS13,
NextProtos: []string{
fmt.Sprintf("yggdrasil/%d.%d", ProtocolVersionMajor, ProtocolVersionMinor),
},
}
return config, nil
}

func (c *Core) verifyTLSCertificate(rawCerts [][]byte, _ [][]*x509.Certificate) error {
if len(rawCerts) != 1 {
return fmt.Errorf("expected one certificate")
}

/*
opts := x509.VerifyOptions{}
cert, err := x509.ParseCertificate(rawCerts[0])
if err != nil {
return fmt.Errorf("failed to parse leaf certificate: %w", err)
}
_, err = cert.Verify(opts)
return err
*/

func (c *Core) verifyTLSCertificate(_ [][]byte, _ [][]*x509.Certificate) error {
return nil
}

func (c *Core) verifyTLSConnection(cs tls.ConnectionState) error {
func (c *Core) verifyTLSConnection(_ tls.ConnectionState) error {
return nil
}

0 comments on commit efb4b46

Please sign in to comment.