Skip to content

Conversation

@GyoOkuda
Copy link

@GyoOkuda GyoOkuda commented Feb 16, 2021

Currently, openapi3 doesn't honor HTTP_PROXY/HTTPS_PROXY environment variable.
and, no another way to set http proxy / ca_bundle in openapi3.

As Described in psf/requests#2807 (comment) , to honor environment variable, environment setting dict should be taken from requests.Session.merge_environment_settings , and requests.Session.send should be called with it.

@Dorthu
Copy link
Owner

Dorthu commented Jul 12, 2021

I believe all of these settings can be specified on the Session object directly; after #39 I think a better solution would be something like this:

def my_session_factory() -> requests.Session:
  session = requests.Session()
  session.verify = True
  session.proxy = "https://some.proxy.org"
  session.cert = ("/path/to/cert", "/path/to/key")
  return session

spec = OpenAPI(some_yaml, session_factory=my_session_factory)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants