mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-19 15:17:43 +01:00
Use insecure transport when creating the adapter for local instance in replication
Use insecure transport when creating the adapter for local instance in replication Signed-off-by: Wenkai Yin <yinw@vmware.com>
This commit is contained in:
parent
12fa69120c
commit
df1f52dba4
@ -36,7 +36,11 @@ func New(registry *model.Registry) (*Adapter, error) {
|
||||
if isLocalHarbor(registry.URL) {
|
||||
authorizer := common_http_auth.NewSecretAuthorizer(registry.Credential.AccessSecret)
|
||||
httpClient := common_http.NewClient(&http.Client{
|
||||
Transport: common_http.GetHTTPTransport(common_http.SecureTransport),
|
||||
// when it's a local Harbor instance, the code runs inside the same process with
|
||||
// core, so insecure transport is ok
|
||||
// If using the secure one, as we'll replace the URL with 127.0.0.1 and this will
|
||||
// cause error "x509: cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs"
|
||||
Transport: common_http.GetHTTPTransport(common_http.InsecureTransport),
|
||||
}, authorizer)
|
||||
client, err := NewClient(registry.URL, httpClient)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user