Prefer tls

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-02-07 14:02:55 +01:00
parent fc46938383
commit 352fb9f9ea
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
3 changed files with 4 additions and 3 deletions

View File

@ -158,7 +158,7 @@ func libp2p() Option {
Override(AddrsFactoryKey, lp2p.AddrsFactory(nil, nil)), Override(AddrsFactoryKey, lp2p.AddrsFactory(nil, nil)),
Override(SmuxTransportKey, lp2p.SmuxTransport(true)), Override(SmuxTransportKey, lp2p.SmuxTransport(true)),
Override(RelayKey, lp2p.Relay(true, false)), Override(RelayKey, lp2p.Relay(true, false)),
Override(SecurityKey, lp2p.Security(true, false)), Override(SecurityKey, lp2p.Security(true, true)),
Override(BaseRoutingKey, lp2p.BaseRouting), Override(BaseRoutingKey, lp2p.BaseRouting),
Override(new(routing.Routing), lp2p.Routing), Override(new(routing.Routing), lp2p.Routing),

View File

@ -47,7 +47,8 @@ func Host(mctx helpers.MetricsCtx, lc fx.Lifecycle, params P2PHostIn) (RawHost,
libp2p.Peerstore(params.Peerstore), libp2p.Peerstore(params.Peerstore),
libp2p.NoListenAddrs, libp2p.NoListenAddrs,
libp2p.Ping(true), libp2p.Ping(true),
libp2p.UserAgent("lotus-" + build.UserVersion)} libp2p.UserAgent("lotus-" + build.UserVersion),
}
for _, o := range params.Opts { for _, o := range params.Opts {
opts = append(opts, o...) opts = append(opts, o...)
} }

View File

@ -15,7 +15,7 @@ func Security(enabled, preferTLS bool) interface{} {
if !enabled { if !enabled {
return func() (opts Libp2pOpts) { return func() (opts Libp2pOpts) {
// TODO: shouldn't this be Errorf to guarantee visibility? // TODO: shouldn't this be Errorf to guarantee visibility?
log.Warnf(`Your IPFS node has been configured to run WITHOUT ENCRYPTED CONNECTIONS. log.Warnf(`Your lotus node has been configured to run WITHOUT ENCRYPTED CONNECTIONS.
You will not be able to connect to any nodes configured to use encrypted connections`) You will not be able to connect to any nodes configured to use encrypted connections`)
opts.Opts = append(opts.Opts, libp2p.NoSecurity) opts.Opts = append(opts.Opts, libp2p.NoSecurity)
return opts return opts