File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package main
22
33import (
44 "context"
5+ "crypto/tls"
56 "errors"
67 "fmt"
78 "net"
@@ -15,6 +16,7 @@ import (
1516 "git.sr.ht/~mpldr/uniview/protocol"
1617 "git.sr.ht/~poldi1405/glog"
1718 "google.golang.org/grpc"
19+ "google.golang.org/grpc/credentials"
1820 "google.golang.org/grpc/credentials/insecure"
1921 "google.golang.org/protobuf/types/known/durationpb"
2022)
@@ -44,6 +46,8 @@ func startClient(u *url.URL) error {
4446 var opts []grpc.DialOption
4547 if u .Query ().Has ("insecure" ) || insecureByDefault (u .Hostname ()) {
4648 opts = append (opts , grpc .WithTransportCredentials (insecure .NewCredentials ()))
49+ } else {
50+ opts = append (opts , grpc .WithTransportCredentials (credentials .NewTLS (& tls.Config {})))
4751 }
4852
4953 gconn , err := grpc .Dial (u .Host , opts ... )
You can’t perform that action at this time.
0 commit comments