Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-01-08 16:59:48 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-01-11 09:59:49 +0300
commite81b6d55cfd30c06c0f3e83e7b8a428b8090d3d9 (patch)
treeb66fc69127b374c45c7f505ac31be23f9d48de50 /client
parenta217fef96cd56e46abb1a8b1c675d83dd80fcdeb (diff)
grpc: Convert from `NewServerTLSFromCert` to `NewTLS`
We're currently using `NewServerTLSFromCert()`, which is inflexible and doesn't allow us to tweak details of the resulting TLS transport credentials. This commit converts them to use an equivalent invocation of `NewTLS()` instead, which allows us to specify the `tls.Config` directly. No change in behaviour is expected from this commit.
Diffstat (limited to 'client')
-rw-r--r--client/dial_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/dial_test.go b/client/dial_test.go
index d7f490906..440622b01 100644
--- a/client/dial_test.go
+++ b/client/dial_test.go
@@ -423,7 +423,9 @@ func startTLSListener() (func(), string, error) {
return nil, "", err
}
- grpcServer := grpc.NewServer(grpc.Creds(credentials.NewServerTLSFromCert(&cert)))
+ grpcServer := grpc.NewServer(grpc.Creds(credentials.NewTLS(&tls.Config{
+ Certificates: []tls.Certificate{cert},
+ })))
healthpb.RegisterHealthServer(grpcServer, &healthServer{})
go grpcServer.Serve(listener)