Skip to content

Commit

Permalink
strip port from TLS server name used in verification
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Callaway <[email protected]>
  • Loading branch information
bobcallaway committed Sep 8, 2024
1 parent 3a1b16e commit 106d278
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/prober/prober.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"log"
"net/http"
"os"
"strings"
"time"

retryablehttp "github.com/hashicorp/go-retryablehttp"
Expand Down Expand Up @@ -196,8 +197,12 @@ func main() {
}

func NewFulcioGrpcClient() (fulciopb.CAClient, error) {
grpcHostname := fulcioGrpcURL
if idx := strings.Index(fulcioGrpcURL, ":"); idx != -1 {
grpcHostname = fulcioGrpcURL[:idx]
}
opts := []grpc.DialOption{grpc.WithUserAgent(options.UserAgent())}
transportCreds := credentials.NewTLS(&tls.Config{MinVersion: tls.VersionTLS12})
transportCreds := credentials.NewTLS(&tls.Config{MinVersion: tls.VersionTLS12, ServerName: grpcHostname})
opts = append(opts, grpc.WithTransportCredentials(transportCreds))
conn, err := grpc.NewClient(fulcioGrpcURL, opts...)
if err != nil {
Expand Down

0 comments on commit 106d278

Please sign in to comment.