From 5294b2b98b0b39293f00cdea78d22c72e3f018dd Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sun, 28 Jul 2019 06:49:08 +0900 Subject: [PATCH] set an ALPN value in the tls.Config --- crypto.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto.go b/crypto.go index b3693b6..a0a52ce 100644 --- a/crypto.go +++ b/crypto.go @@ -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}) @@ -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