Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config setting for custom client certificates #853

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions nmostesting/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@
"test_data/BCP00301/ca/intermediate/private/rsa.mocks.testsuite.nmos.tv.key.pem"
]

# Combined client certificate and key.
# Can be either path to the combined certificate
# or a tuple of (cert_path, key_path).
CERT_CLIENT = None

# Test using authorization as per AMWA IS-10 and BCP-003-02
ENABLE_AUTH = False

Expand Down
2 changes: 1 addition & 1 deletion nmostesting/TestHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def do_request(method, url, headers=None, **kwargs):

req = requests.Request(method, url, headers={k: v for k, v in headers.items() if v is not None}, **kwargs)
prepped = s.prepare_request(req)
settings = s.merge_environment_settings(prepped.url, {}, None, CONFIG.CERT_TRUST_ROOT_CA, None)
settings = s.merge_environment_settings(prepped.url, {}, None, CONFIG.CERT_TRUST_ROOT_CA, CONFIG.CERT_CLIENT)
response = s.send(prepped, timeout=CONFIG.HTTP_TIMEOUT, **settings)
if prepped.url.startswith("https://"):
if not response.url.startswith("https://"):
Expand Down