mirror of
https://github.com/thegeeklab/drone-plugin-lib.git
synced 2024-11-22 10:50:39 +00:00
Expose whether SSL verification is skipped
This commit is contained in:
parent
8fb8284d71
commit
b771a2a224
@ -30,6 +30,9 @@ type Network struct {
|
||||
|
||||
// Client for making network requests.
|
||||
Client *http.Client
|
||||
|
||||
/// Whether SSL verification is skipped
|
||||
SkipVerify bool
|
||||
}
|
||||
|
||||
const networkSkipVerifyFlag = "transport.skip-verify"
|
||||
@ -61,7 +64,8 @@ func NetworkFromContext(ctx *cli.Context) Network {
|
||||
ExpectContinueTimeout: 1 * time.Second,
|
||||
}
|
||||
|
||||
if ctx.Bool(networkSkipVerifyFlag) {
|
||||
skipVerify := ctx.Bool(networkSkipVerifyFlag)
|
||||
if skipVerify {
|
||||
logrus.Warning("ssl verification is turned off")
|
||||
transport.TLSClientConfig = &tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
@ -80,5 +84,6 @@ func NetworkFromContext(ctx *cli.Context) Network {
|
||||
Transport: transport,
|
||||
},
|
||||
Context: context,
|
||||
SkipVerify: skipVerify,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user