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

Documentation on disabling ssl checks #21

Open
RubenGarcia opened this issue Jun 11, 2019 · 2 comments
Open

Documentation on disabling ssl checks #21

RubenGarcia opened this issue Jun 11, 2019 · 2 comments

Comments

@RubenGarcia
Copy link

I have tried disabling ssl checks in order to test the library in a development setting.
In particular, using
https://stackoverflow.com/questions/35875298/python-3-urllib-with-self-signed-certificates
I tried various variations of
ssl._create_default_https_context = ssl._create_unverified_context
at django initialization, but I still get the same SSL error:
HTTPSConnectionPool(host='a.b.c.d', port=8443): Max retries exceeded with url: /auth/realms/REALM/.well-known/openid-configuration (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)'),))

Can you add some documentation on how to disable SSL verification in test environments?
I have not found any information on
https://django-keycloak.readthedocs.io/en/latest/
The "Initial settings" may be a good place to give some pointers.

Thank you.

@RubenGarcia
Copy link
Author

RubenGarcia commented Jun 11, 2019

I changed (inspired by https://stackoverflow.com/questions/15445981/how-do-i-disable-the-security-certificate-check-in-python-requests)
self.verify = True
to
self.verify = False
in requests/sessions.py
but while that removed the SSL error, I now get
JSONDecodeError at /keycloak/login-complete
so there must be something else I'm doing wrong.

@RubenGarcia
Copy link
Author

The JSONDecodeError was a different issue, so please disregard that.
However, there should be an easy way to indicate to django-keycloak that certificate verification should be disabled without disabling it globally at site-packages/requests/sessions.py

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

1 participant