Skip to content

The insecure flag has no effect with a self-issued certificate (GitLab) #44

Description

@Aynyuh

Hello and thank you for the tool.

I think I've found a bug in the gitlab backup implementation. Seems like the gitlab Go module uses its own HTTP client, so setting the global HTTP transport here:

if *enableInsecure {
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
}

does not affect subsequent config.setDefaults -> gitlab.NewClient call:
client, err := gitlab.NewClient(g.AccessToken, gitlab.WithBaseURL(g.URL))

which causes the error in the case of a self-issued certificate:
Image

2026/08/19 12:22:27 Failed to verify connection to job [git]: Get "https://git/api/v4/user": tls: failed to verify certificate: x509: certificate signed by unknown authority

A quick, dirty hack, however, solves this problem:

client, err := gitlab.NewClient(g.AccessToken, gitlab.WithBaseURL(g.URL), gitlab.WithHTTPClient(&http.Client{Transport: http.DefaultTransport}))

I'm not sure if it applies to the GithubConfig implementation. Hope this helps fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions