Skip to content

Commit ed21925

Browse files
committed
set http without ssl
1 parent 1afef7e commit ed21925

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
coverage.out
2+
/.idea
3+
go-git.iml

clients/http/git_upload_pack.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"gopkg.in/src-d/go-git.v4/clients/common"
1212
"gopkg.in/src-d/go-git.v4/core"
1313
"gopkg.in/src-d/go-git.v4/formats/packp/pktline"
14+
"crypto/tls"
1415
)
1516

1617
// GitUploadPackService git-upoad-pack service over HTTP
@@ -23,8 +24,13 @@ type GitUploadPackService struct {
2324
// NewGitUploadPackService connects to a git-upload-pack service over HTTP, the
2425
// auth is extracted from the URL, or can be provided using the SetAuth method
2526
func NewGitUploadPackService(endpoint common.Endpoint) common.GitUploadPackService {
27+
28+
c := http.Client{Transport: &http.Transport{
29+
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
30+
}}
31+
2632
s := &GitUploadPackService{
27-
client: http.DefaultClient,
33+
client: c,
2834
endpoint: endpoint,
2935
}
3036

0 commit comments

Comments
 (0)