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

Unable to turn off cert validation or point to CA bundle #1966

Closed
brsolomon-deloitte opened this issue Dec 20, 2022 · 1 comment
Closed

Unable to turn off cert validation or point to CA bundle #1966

brsolomon-deloitte opened this issue Dec 20, 2022 · 1 comment

Comments

@brsolomon-deloitte
Copy link

brsolomon-deloitte commented Dec 20, 2022

In the following example, API_BASE_URL is an https:// URL with self-signed certificates.

Requests fail with

[2022-12-20T18:17:49.363+0000] {views.py:659} ERROR - Error authorizing OAuth access token: HTTPSConnectionPool(host='keycloak.redacted.redacted, port=443): Max retries exceeded with url: /auth/realms/redacted/protocol/openid-connect/token (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1129)')))

How can we either:

  • Set TLS verification to false, or
  • Preferably, point FAB OAUTH_PROVIDERS config to a CA bundle to validate the cert?
OAUTH_PROVIDERS = [
    {
        "name": "keycloak",
        "token_key": "access_token",
        "icon": "fa-key",
        "remote_app": {
            "api_base_url": API_BASE_URL,
            "client_kwargs": {"scope": "email profile"},
            "access_token_url": f"{API_BASE_URL}/token",
            "authorize_url": f"{API_BASE_URL}/auth",
            "request_token_url": None,
            "client_id": CLIENT_ID,
            "client_secret": CLIENT_SECRET,
        },
    }
]
@dpgaspar
Copy link
Owner

You probably can achieve this at the OS level, add your CA cert to the trusted CA's

something similar to, it depends on the OS:
sudo cp my-self-signed-cert.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates

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

No branches or pull requests

2 participants