aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/client/example_test.go
blob: 8d38673abba1be8c984f84cfb7f1b6cce03de030 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package client_test

import (
	"crypto/tls"
	"net/http"

	"srcd.works/go-git.v4/plumbing/transport/client"
	githttp "srcd.works/go-git.v4/plumbing/transport/http"
)

func ExampleInstallProtocol() {
	// Create custom net/http client that.
	httpClient := &http.Client{
		Transport: &http.Transport{
			TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
		},
	}

	// Install it as default client for https URLs.
	client.InstallProtocol("https", githttp.NewClient(httpClient))
}