Skip to content

Commit

Permalink
feat: logging when ignoring bad certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
vlnevyhosteny committed Mar 19, 2024
1 parent 1fc371d commit b625b2f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/conductorone/baton-sdk/pkg/annotations"
"github.com/conductorone/baton-sdk/pkg/connectorbuilder"
"github.com/conductorone/baton-sdk/pkg/uhttp"
"github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap"
)

type Panorama struct {
Expand Down Expand Up @@ -53,6 +54,9 @@ func (d *Panorama) Validate(ctx context.Context) (annotations.Annotations, error
func New(ctx context.Context, panoramaUrl, username, password string, ignoreBadCertificate bool) (*Panorama, error) {
clientOptions := []uhttp.Option{}
if ignoreBadCertificate {
l := ctxzap.Extract(ctx)
l.Warn("Ignoring bad certificate. This should only be used for testing purposes.")

clientOptions = append(clientOptions, uhttp.WithTLSClientConfig(
&tls.Config{
InsecureSkipVerify: true, // #nosec G402
Expand Down

0 comments on commit b625b2f

Please sign in to comment.