-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Two-way SSL - SSL_ERROR_UNKNOWN_CA_ALERT #1934
Comments
|
I managed to fix this by using stunnel again as an SSL reverse proxy - again specifying to ignore the cert chain and verify only the peer certificate itself. This isn't a gunicorn issue but rather python's ssl library and how it handles peer cert verification. To my knowledge I don't see a way to verify only the peer certificate itself and ignore the chain. In regards to your questions @javabrett ,
|
It's likely that this sort of configuration will only be possible with a fully-configurable |
I am running a Python3 app via Gunicorn with two-way SSL configured. This requires a local cert/key to verify the app as well as a ca_certs file to verify the client.
The service starts and responds to curl requests fine when I use self-signed certificates for both server and client authentication. However when I use certificates signed by another CA, I get an error
SSL_ERROR_UNKNOWN_CA_ALERT
.A working setup, with self-signed certs:
With Gunicorn configured as follows:
And curling as follows:
curl -vk --key twoway.key --cert twoway.crt https://my.service
Produces a successful response:
A failing setup, with a different series of certs:
With Gunicorn configured as follows:
And curling as follows:
curl -vk --key my_trusted_key.key --cert my_trusted_clients.crt https://my.service
Produces an error:
Any thoughts on whether I am configuring this the wrong way? And why self-signed certs are working but other certs are not?
Note this config worked previously when using Stunnel (SSL proxy)+bjoern (wsgi), where I set the stunnel
verify
level to 4 ("Ignore the chain and only verify the peer certificate."). If there is something similar in Python I believe that would get me in the right direction.The text was updated successfully, but these errors were encountered: