feat: tls by default
Switches to TLS as the default security transports.
Steven Allen committed
Mar 29, 2020 at 18:58 UTC
f28b8fce66ea127ddca6b10679cfd466438b5a3d
6 files changed
+11
-29
core/node/groups.go
+1
-1
@@ -102,7 +102,7 @@ func LibP2P(bcfg *BuildCfg, cfg *config.Config) fx.Option {
102
fx.Invoke(libp2p.StartListening(cfg.Addresses.Swarm)),
103
fx.Invoke(libp2p.SetupDiscovery(cfg.Discovery.MDNS.Enabled, cfg.Discovery.MDNS.Interval)),
104
105
- fx.Provide(libp2p.Security(!bcfg.DisableEncryptedConnections, cfg.Experimental.PreferTLS)),
105
+ fx.Provide(libp2p.Security(!bcfg.DisableEncryptedConnections)),
106
107
fx.Provide(libp2p.Routing),
108
fx.Provide(libp2p.BaseRouting),
core/node/libp2p/transport.go
+2
-6
@@ -11,7 +11,7 @@ import (
11
var DefaultTransports = simpleOpt(libp2p.DefaultTransports)
12
var QUIC = simpleOpt(libp2p.Transport(libp2pquic.NewTransport))
13
14
-func Security(enabled, preferTLS bool) interface{} {
14
+func Security(enabled bool) interface{} {
15
if !enabled {
16
return func() (opts Libp2pOpts) {
17
// TODO: shouldn't this be Errorf to guarantee visibility?
@@ -22,11 +22,7 @@ func Security(enabled, preferTLS bool) interface{} {
22
}
23
}
24
return func() (opts Libp2pOpts) {
25
- if preferTLS {
26
- opts.Opts = append(opts.Opts, libp2p.ChainOptions(libp2p.Security(tls.ID, tls.New), libp2p.Security(secio.ID, secio.New)))
27
- } else {
28
- opts.Opts = append(opts.Opts, libp2p.ChainOptions(libp2p.Security(secio.ID, secio.New), libp2p.Security(tls.ID, tls.New)))
29
- }
25
+ opts.Opts = append(opts.Opts, libp2p.ChainOptions(libp2p.Security(tls.ID, tls.New), libp2p.Security(secio.ID, secio.New)))
26
return opts
27
}
28
}
docs/examples/library-experimental-features/README.md
-2
@@ -58,8 +58,6 @@ func createTempRepo(ctx context.Context) (string, error) {
58
cfg.Experimental.P2pHttpProxy = true
59
// https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#quic
60
cfg.Experimental.QUIC = true
61
- // https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#tls-13-as-default-handshake-protocol
62
- cfg.Experimental.PreferTLS = true
61
// https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#strategic-providing
62
cfg.Experimental.StrategicProviding = true
63
docs/experimental-features.md
+5
-17
@@ -632,7 +632,7 @@ For listening on a QUIC address, add it the swarm addresses, e.g. `/ip4/0.0.0.0/
632
633
### In Version
634
635
-0.4.19-dev
635
+0.4.19
636
637
### State
638
@@ -660,26 +660,14 @@ ipfs config --json Swarm.EnableAutoNATService true
660
661
## TLS 1.3 as default handshake protocol
662
663
-### State
664
-
665
-Every go-ipfs node (>=0.4.21) accepts secio and TLS 1.3 connections but prefers
666
-secio over TLS when dialing. To prefer TLS when dialing, you'll have to enable
667
-this feature.
668
-
669
-### How to enable
663
+### In Version
664
671
-Modify your ipfs config:
665
+0.5.0
666
673
-```
674
-ipfs config --json Experimental.PreferTLS true
675
-```
676
-
677
-### Road to being a real feature
667
+### State
668
679
-- [ ] needs testing
680
-- [ ] needs adoption
669
+Stable
670
682
----
671
672
## Strategic Providing
673
go.mod
+1
-1
@@ -31,7 +31,7 @@ require (
31
github.com/ipfs/go-ipfs-blockstore v0.1.4
32
github.com/ipfs/go-ipfs-chunker v0.0.5
33
github.com/ipfs/go-ipfs-cmds v0.1.4
34
- github.com/ipfs/go-ipfs-config v0.3.0
34
+ github.com/ipfs/go-ipfs-config v0.4.0
35
github.com/ipfs/go-ipfs-ds-help v0.1.1
36
github.com/ipfs/go-ipfs-exchange-interface v0.0.1
37
github.com/ipfs/go-ipfs-exchange-offline v0.0.1
go.sum
+2
-2
@@ -246,8 +246,8 @@ github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7Na
246
github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8=
247
github.com/ipfs/go-ipfs-cmds v0.1.4 h1:l5QAc1iaoMZeBd2vpanrHWs26haEBL4PVqgoHJNG2GE=
248
github.com/ipfs/go-ipfs-cmds v0.1.4/go.mod h1:wm+C6M8FYDcWPU/EdWqMuHvdyWborFh+GuDl6Ov6sM0=
249
-github.com/ipfs/go-ipfs-config v0.3.0 h1:fGs3JBqB9ia/Joi8up47uiKn150EOEqqVFwv8HZqXao=
250
-github.com/ipfs/go-ipfs-config v0.3.0/go.mod h1:nSLCFtlaL+2rbl3F+9D4gQZQbT1LjRKx7TJg/IHz6oM=
249
+github.com/ipfs/go-ipfs-config v0.4.0 h1:MOXdj8EYQG55v1y+5e1QcctDKPEGobdwnXaDVa0/cc0=
250
+github.com/ipfs/go-ipfs-config v0.4.0/go.mod h1:nSLCFtlaL+2rbl3F+9D4gQZQbT1LjRKx7TJg/IHz6oM=
251
github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw=
252
github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ=
253
github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw=