This repository has been archived by the owner on Aug 19, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this PR is to evaluate what it would take to use TLS session resumption. Session tickets are stored in the peerstore. We store a maximum of 3 session tickets in a LIFO cache.
The improvements of session resumption in our case are moderate: We decrease the number of bytes that the server sends (as it doesn't have to present a certificate chain), however, the number of bytes the client sends doesn't enjoy the same benefit. This is because the Go standard library implementation saves the client's certificate chain in the session ticket (so it can re-verify it on resumed connections).
Here are some measurements for the 4 different key types that we support in libp2p:
RSA:
1st handshake: Sent: 1308. Received: 1281.
2nd handshake: Sent: 1336. Received: 517.
ECDSA:
1st handshake: Sent: 909. Received: 883.
2nd handshake: Sent: 938. Received: 517.
Ed25519:
1st handshake: Sent: 839. Received: 811.
2nd handshake: Sent: 868. Received: 517.
secp256k1:
1st handshake: Sent: 846. Received: 823.
2nd handshake: Sent: 876. Received: 517.