Skip to content
This repository was archived by the owner on Aug 19, 2022. It is now read-only.

Commit cc53c4f

Browse files
Merge pull request #32 from libp2p/alpn
set an ALPN value in the tls.Config
2 parents b3618ca + 5294b2b commit cc53c4f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crypto.go

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121

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

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

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

0 commit comments

Comments
 (0)