switch from github.com/libp2p/go-libp2p-tls to p2p/security/tls

This commit is contained in:
Marten Seemann 2022-04-27 12:00:11 +02:00
parent 57ea0057d0
commit 27cfd3f4ed
8 changed files with 13 additions and 11 deletions

View File

@ -8,6 +8,7 @@ import (
"github.com/libp2p/go-libp2p/p2p/muxer/yamux"
"github.com/libp2p/go-libp2p/p2p/net/connmgr"
"github.com/libp2p/go-libp2p/p2p/security/noise"
tls "github.com/libp2p/go-libp2p/p2p/security/tls"
quic "github.com/libp2p/go-libp2p/p2p/transport/quic"
"github.com/libp2p/go-libp2p/p2p/transport/tcp"
ws "github.com/libp2p/go-libp2p/p2p/transport/websocket"
@ -16,7 +17,6 @@ import (
"github.com/libp2p/go-libp2p-peerstore/pstoremem"
rcmgr "github.com/libp2p/go-libp2p-resource-manager"
tls "github.com/libp2p/go-libp2p-tls"
"github.com/multiformats/go-multiaddr"
)

4
go.mod
View File

@ -26,7 +26,6 @@ require (
github.com/libp2p/go-libp2p-pnet v0.2.0
github.com/libp2p/go-libp2p-resource-manager v0.2.1
github.com/libp2p/go-libp2p-testing v0.9.2
github.com/libp2p/go-libp2p-tls v0.4.1
github.com/libp2p/go-mplex v0.7.0
github.com/libp2p/go-msgio v0.2.0
github.com/libp2p/go-netroute v0.2.0
@ -52,6 +51,7 @@ require (
github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad
)
require (
@ -82,6 +82,7 @@ require (
github.com/libp2p/go-libp2p-blankhost v0.3.0 // indirect
github.com/libp2p/go-libp2p-quic-transport v0.17.0 // indirect
github.com/libp2p/go-libp2p-swarm v0.10.2 // indirect
github.com/libp2p/go-libp2p-tls v0.4.1 // indirect
github.com/libp2p/go-libp2p-transport-upgrader v0.7.1 // indirect
github.com/libp2p/go-libp2p-yamux v0.9.1 // indirect
github.com/libp2p/go-nat v0.1.0 // indirect
@ -117,7 +118,6 @@ require (
go.uber.org/zap v1.21.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220418201149-a630d4f3e7a2 // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/tools v0.1.10 // indirect
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
google.golang.org/grpc v1.45.0 // indirect

View File

@ -4,7 +4,7 @@ import (
"fmt"
"os"
"github.com/libp2p/go-libp2p-tls/cmd/tlsdiag"
"github.com/libp2p/go-libp2p/p2p/security/tls/cmd/tlsdiag"
)
func main() {

View File

@ -8,8 +8,9 @@ import (
"net"
"time"
libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
"github.com/libp2p/go-libp2p-core/peer"
libp2ptls "github.com/libp2p/go-libp2p-tls"
)
func StartClient() error {

View File

@ -7,8 +7,9 @@ import (
"net"
"time"
libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
"github.com/libp2p/go-libp2p-core/peer"
libp2ptls "github.com/libp2p/go-libp2p-tls"
)
func StartServer() error {

View File

@ -93,7 +93,7 @@ func (t *Transport) handshake(ctx context.Context, tlsConn *tls.Conn, keyCh <-ch
default:
}
if remotePubKey == nil {
return nil, errors.New("go-libp2p-tls BUG: expected remote pub key to be set")
return nil, errors.New("go-libp2p tls BUG: expected remote pub key to be set")
}
return t.setupConn(tlsConn, remotePubKey)

View File

@ -5,13 +5,13 @@ import (
"crypto/tls"
"net"
p2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
ic "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
tpt "github.com/libp2p/go-libp2p-core/transport"
p2ptls "github.com/libp2p/go-libp2p-tls"
"github.com/lucas-clemente/quic-go"
ma "github.com/multiformats/go-multiaddr"
)

View File

@ -12,6 +12,8 @@ import (
"golang.org/x/crypto/hkdf"
p2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
"github.com/libp2p/go-libp2p-core/connmgr"
ic "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/network"
@ -19,8 +21,6 @@ import (
"github.com/libp2p/go-libp2p-core/pnet"
tpt "github.com/libp2p/go-libp2p-core/transport"
p2ptls "github.com/libp2p/go-libp2p-tls"
ma "github.com/multiformats/go-multiaddr"
mafmt "github.com/multiformats/go-multiaddr-fmt"
manet "github.com/multiformats/go-multiaddr/net"