ssl.SSLCertVerificationError for flask application OAuth login with keycloak ssl.SSLCertVerificationError for flask application OAuth login with keycloak flask flask

ssl.SSLCertVerificationError for flask application OAuth login with keycloak


That's a problem of flask-oidc. It uses httplib2, which offers disable_ssl_certificate_validation option to disable ssl/tls cert verification, but unfortunately it is not configurable from the flask-oidc.

The only option is to add CA cert which was used to create TLS cert for https://keycloak-keycloak.router.default.svc.cluster.local.167.254.224.26.nip.io to the httplib2 ca certs:

cat ca-cert.crt >> [path_to_python_libs]/certifi/cacert.pem

Offtopic: your deployment looks like Kubernetes, so it should be easy to get ca-cert.crt from the cluster and copy it to right place when app is starting.