Skip to content

Ensure that xcover client uses REQUESTS_CA_BUNDLE#6

Open
jec006 wants to merge 1 commit intoCoverGenius:masterfrom
jec006:master
Open

Ensure that xcover client uses REQUESTS_CA_BUNDLE#6
jec006 wants to merge 1 commit intoCoverGenius:masterfrom
jec006:master

Conversation

@jec006
Copy link

@jec006 jec006 commented Aug 19, 2025

... Along with other requests ENV settings.

See https://requests.readthedocs.io/en/latest/user/advanced/#prepared-requests

Here are the steps to help reproduce the issue and show that this solution works.

import requests
session = requests.Session()
request = requests.Request('GET', 'https://api.xcover.com/x/', headers={"Content-Type": "application/json"})
prepared_request: requests.PreparedRequest = session.prepare_request(request)

# throws an SSL error (prepared request isn't using ENV vars)
session.send(prepared_request)

# works (non-prepared request)
requests.get('https://api.xcover.com/x/', headers={"Content-Type": "application/json"})

# works w/ prepared request by importing settings from env vars
settings = session.merge_environment_settings(prepared_request.url, {}, None, None, None)
session.send(prepared_request, **settings)

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.

1 participant