-
-
Notifications
You must be signed in to change notification settings - Fork 486
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
Client Certificate not being used? #1793
Comments
~~Misconfigured TLS wouldn't give you a 400 error, it wouldn't give you an HTTP error at all. Can you get any detail from the response body or the server as to what the 400 response actually contains?~~ Turns out nginx gives a 400 error on TLS issues? This is surprising, I'd expect the connection to simply not succeed. Will check the logs later. |
@kceleslie it's a bit late because we can't completely hide it, but I've edited your comment to remove the link to logs: they contain all manner of sensitive data! I will make the logs accessible to @growse Edit: oh, I can actually delete the comment revision (TIL) which I've now done. |
Oh man, thanks! |
Yeah, so if i curl POST without a cert i get a HTTP 400
If i provide my cert i get HTTP 200
|
Please show us (without divulging the domain name) how you created both the CA and the client certificate. |
I did it with a GUI. I'll work on testing/documenting with openssl |
Try mkcert before you fall into the trap that is "trying to do what you meant to do with openssl". |
I'm used to working with openssl. Here is what i did. Creating the CA
Create client key and csr request
Sign cert with rootCA
Create PFX
nginix config
|
That looks sane to me, at least I see nothing glaringly wrong with either the certificates nor the nginx config. @growse it really appears to be that the cert isn't sent off. I believe this to be the relevant (slightly redacted) portion of OP's initial log:
|
I tested the same steps on an IOS device, got the same HTTP 400 error. I'm thinking that I might have done something wrong. Not sure if it's on the nginx side or on the certificate side. |
iOS does support TLS client certificates in MQTT mode only (https://owntracks.org/booklet/features/tlscert/#client-certificates) |
I've had the world's briefest glances at the implementation, and the HTTP handler uses the same socket handler (and therefore TLS code) as the MQTT one. So this certainly warrants closer inspection, and it's not just "forgot to implement it lol". |
Can reproduce. Weird issue. Wasn't helped by the TLS client cert / CA UI being hidden in HTTP mode, but that's fixed now. |
Think I got this one. My local nginx with:
seems to accept requests and return responses with a client cert set. You can either try and build off master or wait for the 2.5.2 to test the fix? |
I'll wait. Thanks! |
2.5.2 is out on the play store. Let me know if it fixes! |
@kceleslie did this fix? |
Yep, seems to work for me |
I've got nginx configured as a reverse proxy. I'm also using HTTP instead of MQTT. I've configured it to use TLS with a self signed certificate and it requires a client certificate for it to accept the connection. I've uploaded the root CA for the TLS into android's store and i've also installed the client certificate. If i use google chrome on the device I get prompted for my certificate and am able to connect to the web interface.
When the client tries to connect i see logs in nginx, it always returns an HTTP 400. I've tried using curl to manually POST with and without a client cert. It works if i use the cert, but if i dont provide a certificate i receive the same HTTP 400 error. It looks to me that the app is not sending the client certificate with the request.
Do i need to create the client cert in a specific way? Attached is the log file from the android client. I also tried it on another phone. Not sure of the Android version but it was also installed via the play store.
The text was updated successfully, but these errors were encountered: