Skip to content

Commit

Permalink
client-sdk: allow insecure connections to localhost address
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrus committed Oct 16, 2024
1 parent 3b02f11 commit 885a055
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions client-sdk/go/config/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package config
import (
"fmt"
"net/url"
"strings"

"github.com/oasisprotocol/oasis-core/go/common/crypto/hash"
)
Expand Down Expand Up @@ -136,8 +135,3 @@ func (n *Network) Validate() error {

return nil
}

// IsLocalRPC checks whether the RPC endpoint points to a local UNIX socket.
func (n *Network) IsLocalRPC() bool {
return strings.HasPrefix(n.RPC, "unix:")
}
2 changes: 1 addition & 1 deletion client-sdk/go/connection/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func Connect(ctx context.Context, net *config.Network) (Connection, error) {
// omitting the chain context check.
func ConnectNoVerify(_ context.Context, net *config.Network) (Connection, error) {
var dialOpts []grpc.DialOption
switch net.IsLocalRPC() {
switch cmnGrpc.IsLocalAddress(net.RPC) {
case true:
// No TLS needed for local nodes.
dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials()))
Expand Down

0 comments on commit 885a055

Please sign in to comment.