switch from github.com/libp2p/go-libp2p-tls to p2p/security/tls
This commit is contained in:
parent
57ea0057d0
commit
27cfd3f4ed
|
@ -8,6 +8,7 @@ import (
|
||||||
"github.com/libp2p/go-libp2p/p2p/muxer/yamux"
|
"github.com/libp2p/go-libp2p/p2p/muxer/yamux"
|
||||||
"github.com/libp2p/go-libp2p/p2p/net/connmgr"
|
"github.com/libp2p/go-libp2p/p2p/net/connmgr"
|
||||||
"github.com/libp2p/go-libp2p/p2p/security/noise"
|
"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"
|
quic "github.com/libp2p/go-libp2p/p2p/transport/quic"
|
||||||
"github.com/libp2p/go-libp2p/p2p/transport/tcp"
|
"github.com/libp2p/go-libp2p/p2p/transport/tcp"
|
||||||
ws "github.com/libp2p/go-libp2p/p2p/transport/websocket"
|
ws "github.com/libp2p/go-libp2p/p2p/transport/websocket"
|
||||||
|
@ -16,7 +17,6 @@ import (
|
||||||
|
|
||||||
"github.com/libp2p/go-libp2p-peerstore/pstoremem"
|
"github.com/libp2p/go-libp2p-peerstore/pstoremem"
|
||||||
rcmgr "github.com/libp2p/go-libp2p-resource-manager"
|
rcmgr "github.com/libp2p/go-libp2p-resource-manager"
|
||||||
tls "github.com/libp2p/go-libp2p-tls"
|
|
||||||
"github.com/multiformats/go-multiaddr"
|
"github.com/multiformats/go-multiaddr"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
4
go.mod
4
go.mod
|
@ -26,7 +26,6 @@ require (
|
||||||
github.com/libp2p/go-libp2p-pnet v0.2.0
|
github.com/libp2p/go-libp2p-pnet v0.2.0
|
||||||
github.com/libp2p/go-libp2p-resource-manager v0.2.1
|
github.com/libp2p/go-libp2p-resource-manager v0.2.1
|
||||||
github.com/libp2p/go-libp2p-testing v0.9.2
|
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-mplex v0.7.0
|
||||||
github.com/libp2p/go-msgio v0.2.0
|
github.com/libp2p/go-msgio v0.2.0
|
||||||
github.com/libp2p/go-netroute 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
|
github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7
|
||||||
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
|
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
|
||||||
|
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
@ -82,6 +82,7 @@ require (
|
||||||
github.com/libp2p/go-libp2p-blankhost v0.3.0 // indirect
|
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-quic-transport v0.17.0 // indirect
|
||||||
github.com/libp2p/go-libp2p-swarm v0.10.2 // 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-transport-upgrader v0.7.1 // indirect
|
||||||
github.com/libp2p/go-libp2p-yamux v0.9.1 // indirect
|
github.com/libp2p/go-libp2p-yamux v0.9.1 // indirect
|
||||||
github.com/libp2p/go-nat v0.1.0 // indirect
|
github.com/libp2p/go-nat v0.1.0 // indirect
|
||||||
|
@ -117,7 +118,6 @@ require (
|
||||||
go.uber.org/zap v1.21.0 // indirect
|
go.uber.org/zap v1.21.0 // indirect
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // 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/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/tools v0.1.10 // indirect
|
||||||
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
|
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
|
||||||
google.golang.org/grpc v1.45.0 // indirect
|
google.golang.org/grpc v1.45.0 // indirect
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/libp2p/go-libp2p-tls/cmd/tlsdiag"
|
"github.com/libp2p/go-libp2p/p2p/security/tls/cmd/tlsdiag"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -8,8 +8,9 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
|
||||||
|
|
||||||
"github.com/libp2p/go-libp2p-core/peer"
|
"github.com/libp2p/go-libp2p-core/peer"
|
||||||
libp2ptls "github.com/libp2p/go-libp2p-tls"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func StartClient() error {
|
func StartClient() error {
|
||||||
|
|
|
@ -7,8 +7,9 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
|
||||||
|
|
||||||
"github.com/libp2p/go-libp2p-core/peer"
|
"github.com/libp2p/go-libp2p-core/peer"
|
||||||
libp2ptls "github.com/libp2p/go-libp2p-tls"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func StartServer() error {
|
func StartServer() error {
|
||||||
|
|
|
@ -93,7 +93,7 @@ func (t *Transport) handshake(ctx context.Context, tlsConn *tls.Conn, keyCh <-ch
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
if remotePubKey == nil {
|
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)
|
return t.setupConn(tlsConn, remotePubKey)
|
||||||
|
|
|
@ -5,13 +5,13 @@ import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
|
p2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
|
||||||
|
|
||||||
ic "github.com/libp2p/go-libp2p-core/crypto"
|
ic "github.com/libp2p/go-libp2p-core/crypto"
|
||||||
"github.com/libp2p/go-libp2p-core/network"
|
"github.com/libp2p/go-libp2p-core/network"
|
||||||
"github.com/libp2p/go-libp2p-core/peer"
|
"github.com/libp2p/go-libp2p-core/peer"
|
||||||
tpt "github.com/libp2p/go-libp2p-core/transport"
|
tpt "github.com/libp2p/go-libp2p-core/transport"
|
||||||
|
|
||||||
p2ptls "github.com/libp2p/go-libp2p-tls"
|
|
||||||
|
|
||||||
"github.com/lucas-clemente/quic-go"
|
"github.com/lucas-clemente/quic-go"
|
||||||
ma "github.com/multiformats/go-multiaddr"
|
ma "github.com/multiformats/go-multiaddr"
|
||||||
)
|
)
|
||||||
|
|
|
@ -12,6 +12,8 @@ import (
|
||||||
|
|
||||||
"golang.org/x/crypto/hkdf"
|
"golang.org/x/crypto/hkdf"
|
||||||
|
|
||||||
|
p2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
|
||||||
|
|
||||||
"github.com/libp2p/go-libp2p-core/connmgr"
|
"github.com/libp2p/go-libp2p-core/connmgr"
|
||||||
ic "github.com/libp2p/go-libp2p-core/crypto"
|
ic "github.com/libp2p/go-libp2p-core/crypto"
|
||||||
"github.com/libp2p/go-libp2p-core/network"
|
"github.com/libp2p/go-libp2p-core/network"
|
||||||
|
@ -19,8 +21,6 @@ import (
|
||||||
"github.com/libp2p/go-libp2p-core/pnet"
|
"github.com/libp2p/go-libp2p-core/pnet"
|
||||||
tpt "github.com/libp2p/go-libp2p-core/transport"
|
tpt "github.com/libp2p/go-libp2p-core/transport"
|
||||||
|
|
||||||
p2ptls "github.com/libp2p/go-libp2p-tls"
|
|
||||||
|
|
||||||
ma "github.com/multiformats/go-multiaddr"
|
ma "github.com/multiformats/go-multiaddr"
|
||||||
mafmt "github.com/multiformats/go-multiaddr-fmt"
|
mafmt "github.com/multiformats/go-multiaddr-fmt"
|
||||||
manet "github.com/multiformats/go-multiaddr/net"
|
manet "github.com/multiformats/go-multiaddr/net"
|
||||||
|
|
Loading…
Reference in New Issue