Skip to content

Commit fd4fc92

Browse files
committed
Add an header to disable TLS verify (Fix #115)
1 parent 4595d51 commit fd4fc92

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,7 @@ $ scw inspect myserver | jq '.[0].public_ip.address'
10511051
* `scw inspect TYPE:xxx TYPE:yyy` will only refresh cache for `TYPE`
10521052
* Sorting cache search by Levenshtein distance ([#87](https://github.com/scaleway/scaleway-cli/issues/87))
10531053
* Allow set up api endpoint using the environment variable $scaleway_api_endpoint
1054+
* Use TLS and verify can now be disabled using `SCALEWAY_TLSVERIFY=0` env var ([#115](https://github.com/scaleway/scaleway-cli/issues/115))
10541055

10551056
#### Fixes
10561057

pkg/api/api.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package api
99

1010
import (
1111
"bytes"
12+
"crypto/tls"
1213
"encoding/json"
1314
"fmt"
1415
"net/http"
@@ -557,6 +558,12 @@ func NewScalewayAPI(apiEndPoint, accountEndPoint, organization, token string) (*
557558
client: &http.Client{},
558559
}
559560

561+
if os.Getenv("SCALEWAY_TLSVERIFY") == "0" {
562+
s.client.Transport = &http.Transport{
563+
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
564+
}
565+
}
566+
560567
return s, nil
561568
}
562569

0 commit comments

Comments
 (0)