Skip to content

Commit

Permalink
add an experiment to prefer TLS 1.3 over secio
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Marten Seemann <martenseemann@gmail.com>
  • Loading branch information
marten-seemann committed Apr 18, 2019
1 parent 810460b commit 1a9467f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,11 @@ func (n *IpfsNode) startOnlineServices(ctx context.Context, routingOption Routin
libp2pOpts = append(libp2pOpts, libp2p.DefaultTransports)

// enable secio and TLS
libp2pOpts = append(libp2pOpts, libp2p.ChainOptions(libp2p.Security(secio.ID, secio.New), libp2p.Security(tls.ID, tls.New)))
if cfg.Experimental.PreferTLS {
libp2pOpts = append(libp2pOpts, libp2p.ChainOptions(libp2p.Security(tls.ID, tls.New), libp2p.Security(secio.ID, secio.New)))
} else {
libp2pOpts = append(libp2pOpts, libp2p.ChainOptions(libp2p.Security(secio.ID, secio.New), libp2p.Security(tls.ID, tls.New)))
}

if cfg.Experimental.QUIC {
libp2pOpts = append(libp2pOpts, libp2p.Transport(quic.NewTransport))
Expand Down
19 changes: 19 additions & 0 deletions docs/experimental-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -683,3 +683,22 @@ ipfs config --json Swarm.EnableAutoNATService true
### Road to being a real feature

- [ ] needs testing


## TLS 1.3 as default handshake protocol

### State

Every node accepts secio and TLS 1.3 connections, but prefers secio over TLS when dialing.

### How to enable

Modify your ipfs config:

```
ipfs config --json Experimental.PreferTLS true
```

### Road to being a real feature

- [ ] needs testing

0 comments on commit 1a9467f

Please sign in to comment.