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

handle self signed certificates for http client #7

Closed
dtrifiro opened this issue Nov 7, 2023 · 1 comment
Closed

handle self signed certificates for http client #7

dtrifiro opened this issue Nov 7, 2023 · 1 comment
Labels
kind/enhancement New feature or request rhods-2.5

Comments

@dtrifiro
Copy link
Contributor

dtrifiro commented Nov 7, 2023

No description provided.

@dtrifiro
Copy link
Contributor Author

The user can specify whether TLS is enabled in the config, and provide a custom ca certificate, which will be used to validate the requests:

class HTTPConfig:
host: str
port: int
tls: bool = False
mtls: bool = False
client_key_path: Optional[str] = None
client_crt_path: Optional[str] = None
ca_crt_path: Optional[str] = None

if self.tls or self.mtls:
if http_config.ca_crt_path:
self.ca_crt_path = http_config.ca_crt_path
else:
raise ValueError(
"The CA cert is required for TLS and mTlS configuration"
)
if self.mtls:
if http_config.client_crt_path and http_config.client_key_path:
self.client_crt_path = http_config.client_crt_path
self.client_key_path = http_config.client_key_path
else:
raise ValueError("Client key and certificates are required for mTLS")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request rhods-2.5
Projects
Status: Done
Status: Done
Development

No branches or pull requests

2 participants