Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-tls
Commits
5294b2b9
Commit
5294b2b9
authored
Jul 28, 2019
by
Marten Seemann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set an ALPN value in the tls.Config
parent
06ff3084
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
crypto.go
crypto.go
+2
-0
No files found.
crypto.go
View file @
5294b2b9
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment