Skip to content
This repository was archived by the owner on Dec 18, 2020. It is now read-only.

Commit aac7a2e

Browse files
committed
Merge pull request #38 from phrase/skip-ssl-verification
Skip ssl verification
2 parents b10a2a5 + 60c3459 commit aac7a2e

File tree

6 files changed

+105
-82
lines changed

6 files changed

+105
-82
lines changed

Godeps/Godeps.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package main
2+
3+
import (
4+
"crypto/tls"
5+
"net/http"
6+
"os"
7+
8+
"github.com/phrase/phraseapp-client/Godeps/_workspace/src/github.com/phrase/phraseapp-go/phraseapp"
9+
)
10+
11+
func newClient(creds *phraseapp.Credentials) (*phraseapp.Client, error) {
12+
c, err := phraseapp.NewClient(creds)
13+
if err != nil {
14+
return nil, err
15+
}
16+
if os.Getenv("PHRASEAPP_INSECURE_SKIP_VERIFY") == "true" {
17+
tr := &http.Transport{
18+
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
19+
}
20+
c.Client = http.Client{Transport: tr}
21+
}
22+
return c, nil
23+
}

pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (cmd *PullCommand) Run() error {
2323
cmd.Debug = false
2424
Debug = true
2525
}
26-
client, err := phraseapp.NewClient(cmd.Config.Credentials)
26+
client, err := newClient(cmd.Config.Credentials)
2727
if err != nil {
2828
return err
2929
}

push.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (cmd *PushCommand) Run() error {
2525
Debug = true
2626
}
2727

28-
client, err := phraseapp.NewClient(cmd.Config.Credentials)
28+
client, err := newClient(cmd.Config.Credentials)
2929
if err != nil {
3030
return err
3131
}

0 commit comments

Comments
 (0)