Skip to content

Commit

Permalink
fix: Nil panic for InsecureSkipVerify
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Blatt <[email protected]>
(cherry picked from commit c0460c5)
  • Loading branch information
MisterMX authored and github-actions[bot] committed Feb 27, 2024
1 parent 0e11dcb commit dc8be3d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/clients/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package clients

import (
"context"
"crypto/tls"
"net/http"
"time"

Expand Down Expand Up @@ -53,6 +54,11 @@ func NewClient(c Config) *gitlab.Client {
}
if c.InsecureSkipVerify {
transport := cleanhttp.DefaultPooledTransport()
if transport.TLSClientConfig == nil {
transport.TLSClientConfig = &tls.Config{
MinVersion: tls.VersionTLS12,
}
}
transport.TLSClientConfig.InsecureSkipVerify = true
httpclient := &http.Client{
Transport: transport,
Expand Down

0 comments on commit dc8be3d

Please sign in to comment.