77 "context"
88 "crypto/tls"
99 "fmt"
10- grpcCredentials "google.golang.org/grpc/credentials"
11- "google.golang.org/grpc/credentials/insecure"
1210 "net/url"
1311 "os"
1412 "testing"
@@ -25,6 +23,8 @@ import (
2523 "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Operations"
2624 "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Scripting"
2725 "google.golang.org/grpc"
26+ grpcCredentials "google.golang.org/grpc/credentials"
27+ "google.golang.org/grpc/credentials/insecure"
2828 "google.golang.org/grpc/metadata"
2929 "google.golang.org/protobuf/proto"
3030 "google.golang.org/protobuf/types/known/durationpb"
@@ -339,9 +339,11 @@ func TestStaticCredentials(t *testing.T) {
339339
340340 staticCredentials := credentials .NewStaticCredentials ("root" , "" , url .Host , func () grpc.DialOption {
341341 if url .Scheme == "grpcs" {
342- transportCredentials , err := grpcCredentials .NewClientTLSFromFile (os .Getenv ("YDB_SSL_ROOT_CERTIFICATES_FILE" ), "" )
342+ transportCredentials , transportCredentialsErr := grpcCredentials .NewClientTLSFromFile (
343+ os .Getenv ("YDB_SSL_ROOT_CERTIFICATES_FILE" ), url .Hostname (),
344+ )
343345 if err != nil {
344- t .Fatalf ("cannot create transport credentials: %v" , err )
346+ t .Fatalf ("cannot create transport credentials: %v" , transportCredentialsErr )
345347 }
346348 return grpc .WithTransportCredentials (transportCredentials )
347349 }
0 commit comments