Skip to content

Commit

Permalink
feat: remove secio support
Browse files Browse the repository at this point in the history
We've had a reliable and enabled by default TLS implementation since
0.4.23 (over a year ago) and turned off SECIO in September of last year.
We might as well remove support entirely in the next release and
encourage users to upgrade their networks.

Noise is faster, anyways.
  • Loading branch information
Stebalien committed Feb 25, 2021
1 parent 6527675 commit ccc2d23
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 364 deletions.
1 change: 0 additions & 1 deletion cmd/seccat/.gitignore

This file was deleted.

255 changes: 0 additions & 255 deletions cmd/seccat/seccat.go

This file was deleted.

8 changes: 0 additions & 8 deletions cmd/seccat/seccat_plan9.go

This file was deleted.

10 changes: 0 additions & 10 deletions cmd/seccat/seccat_posix.go

This file was deleted.

47 changes: 0 additions & 47 deletions cmd/seccat/util.go

This file was deleted.

14 changes: 9 additions & 5 deletions core/node/libp2p/sec.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import (
config "github.com/ipfs/go-ipfs-config"
"github.com/libp2p/go-libp2p"
noise "github.com/libp2p/go-libp2p-noise"
secio "github.com/libp2p/go-libp2p-secio"
tls "github.com/libp2p/go-libp2p-tls"
)

const secioEnabledWarning = `The SECIO security transport was enabled in the config but is no longer supported.
SECIO disabled by default in go-ipfs 0.7 removed in go-ipfs 0.9. Please remove
Swarm.Transports.Security.SECIO from your IPFS config.`

func Security(enabled bool, tptConfig config.Transports) interface{} {
if !enabled {
return func() (opts Libp2pOpts) {
Expand All @@ -18,16 +22,16 @@ func Security(enabled bool, tptConfig config.Transports) interface{} {
}
}

if _, enabled := tptConfig.Security.SECIO.WithDefault(config.Disabled); enabled {
log.Error(secioEnabledWarning)
}

// Using the new config options.
return func() (opts Libp2pOpts) {
opts.Opts = append(opts.Opts, prioritizeOptions([]priorityOption{{
priority: tptConfig.Security.TLS,
defaultPriority: 100,
opt: libp2p.Security(tls.ID, tls.New),
}, {
priority: tptConfig.Security.SECIO,
defaultPriority: config.Disabled,
opt: libp2p.Security(secio.ID, secio.New),
}, {
priority: tptConfig.Security.Noise,
defaultPriority: 300,
Expand Down
12 changes: 2 additions & 10 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -1352,8 +1352,7 @@ receiver supports. When establishing an _inbound_ connection, go-ipfs will let
the initiator choose the protocol, but will refuse to use any of the disabled
transports.

Supported transports are: TLS (priority 100), SECIO (Disabled: i.e. priority false), Noise
(priority 300).
Supported transports are: TLS (priority 100) and Noise (priority 300).

No default priority will ever be less than 100.

Expand All @@ -1369,14 +1368,7 @@ Type: `priority`

#### `Swarm.Transports.Security.SECIO`

[SECIO](https://github.com/libp2p/specs/tree/master/secio) was the most widely
supported IPFS & libp2p security transport. However, it is currently being
phased out in favor of more popular and better vetted protocols like TLS and
Noise.

Default: `false`

Type: `priority`
Support for SECIO has been removed. Please remove this option from your config.

#### `Swarm.Transports.Security.Noise`

Expand Down
Loading

0 comments on commit ccc2d23

Please sign in to comment.