Skip to content

Commit

Permalink
fix example to explicitly set port for gRPC call
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Callaway <[email protected]>
  • Loading branch information
bobcallaway committed Aug 10, 2022
1 parent 7764cdb commit 3aa5db3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/request-certificate/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
request-certificate
5 changes: 4 additions & 1 deletion examples/request-certificate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ func NewClient(fulcioURL string) (fulciopb.CAClient, error) {
return nil, err
}
dialOpt := grpc.WithTransportCredentials(insecure.NewCredentials())
hostWithPort := fmt.Sprintf("%s:80", fulcioServer.Host)
if fulcioServer.Scheme == "https" {
dialOpt = grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{}))
hostWithPort = fmt.Sprintf("%s:443", fulcioServer.Host)
}
conn, err := grpc.Dial(fulcioServer.Host, dialOpt)

conn, err := grpc.Dial(hostWithPort, dialOpt)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 3aa5db3

Please sign in to comment.