Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

enable passing in a http client, for customizing TLS config and timeouts #13

Merged

Conversation

nickysemenza
Copy link
Contributor

i'm using this to allow setting custom timeouts and tls config like so:

dr := dac.NewRequest(...)
verifyCert := func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error {
    // 
    return nil
}
dr.HTTPClient = &http.Client{
    Timeout: 15 * time.Second,
    Transport: &http.Transport{
        TLSClientConfig: &tls.Config{
            InsecureSkipVerify: true,
            VerifyPeerCertificate: verifyCert,
        },
    },
}
res, err = dr.Execute()

I've kept it backwards compatible with the existing CertVal functionality

@amuttsch
Copy link

amuttsch commented May 3, 2019

@xinsnake Can you review and merge this PR please? I could use this functionality in one of my projects.

@xinsnake xinsnake merged commit 41469e9 into xinsnake:master May 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants