Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Add environment variable switch for certificates. #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LeonLiuY
Copy link

Since the DefaultClient is created at package initialize phase, the only way to put this switch is environment variable.

@mattrobenolt
Copy link
Contributor

Could we not expose a method to set them? I imagine people also wanted to just explicitly give the certs to use. So something like, client.SetRootCA() or something.

@LeonLiuY
Copy link
Author

client.Transport is an interface with only 1 method Send. I have 2 choices:

  • cast it to http.Transport.
  • recreate another http.Transport.

Neither is good smell to me. But I implemented the latter.

PR is updated

@kwargs
Copy link

kwargs commented May 18, 2018

Hi @mattrobenolt

Do you have any plans to merge this PR?
This PR is very helpful with self-signed-ceritificates.

@dcramer
Copy link
Member

dcramer commented Oct 23, 2018

If we're still committed to this being a good (enough) implementation I'm happy to get this merged. In general it seems fine to me, and is probably nicer than an env variable. I do know the env variable pattern does exist elsewhere, but usually its for general "load certs from here".

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.

4 participants