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

Commit

Permalink
use TLS session resumption, store session tickets in the peerstore
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Aug 1, 2020
1 parent ef83371 commit 7c3be52
Show file tree
Hide file tree
Showing 5 changed files with 238 additions and 87 deletions.
3 changes: 2 additions & 1 deletion crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
const certValidityPeriod = 100 * 365 * 24 * time.Hour // ~100 years
const certificatePrefix = "libp2p-tls-handshake:"
const alpn string = "libp2p"
const peerStoreKey = "libp2p-tls-session-cache"

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

Expand Down Expand Up @@ -52,7 +53,7 @@ func NewIdentity(privKey ic.PrivKey) (*Identity, error) {
panic("tls config not specialized for peer")
},
NextProtos: []string{alpn},
SessionTicketsDisabled: true,
SessionTicketsDisabled: false,
},
}, nil
}
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ module github.com/libp2p/go-libp2p-tls
go 1.14

require (
github.com/libp2p/go-libp2p-core v0.3.0
github.com/libp2p/go-libp2p-core v0.6.1
github.com/libp2p/go-libp2p-peerstore v0.2.6
github.com/onsi/ginkgo v1.12.0
github.com/onsi/gomega v1.9.0
golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5
)
Loading

0 comments on commit 7c3be52

Please sign in to comment.