Skip to content

Commit

Permalink
set an ALPN value in the tls.Config
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Jul 27, 2019
1 parent 250af20 commit 08736ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions p2p/security/tls/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

const certValidityPeriod = 100 * 365 * 24 * time.Hour // ~100 years
const certificatePrefix = "libp2p-tls-handshake:"
const alpn string = "libp2p"

var extensionID = getPrefixedExtensionID([]int{1, 1})

Expand Down Expand Up @@ -50,6 +51,7 @@ func NewIdentity(privKey ic.PrivKey) (*Identity, error) {
VerifyPeerCertificate: func(_ [][]byte, _ [][]*x509.Certificate) error {
panic("tls config not specialized for peer")
},
NextProtos: []string{alpn},
SessionTicketsDisabled: true,
},
}, nil
Expand Down

0 comments on commit 08736ac

Please sign in to comment.