-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add skip tls verify configuration when fetching token from slef…
…-signed certificate registry Signed-off-by: chwetion <chwetion@foxmail.com>
- Loading branch information
chwetion
committed
Nov 11, 2022
1 parent
ac4f39a
commit 8ba7f53
Showing
3 changed files
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package httputil | ||
|
||
import ( | ||
"crypto/tls" | ||
"net/http" | ||
) | ||
|
||
func SkipTLSClient(insecure bool) *http.Client { | ||
if !insecure { | ||
return http.DefaultClient | ||
} | ||
return &http.Client{ | ||
Transport: &http.Transport{ | ||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, | ||
}, | ||
} | ||
} |