I'm testing 2-way ssl with play-ws with a simple program that connects to a nginx server
Client authentication fails with this message
400 Bad Request
No required SSL certificate was sent
My application.conf has specified both a trust store and a keystore:
I have tested this with a low level java client that uses the same trust store and keystores:
and it works. I've also tested it with curl using the --cert option to specify a client key and it also works.
I've tried debugging the ssl output of the play-ws code and found that the client key is being loaded correctly:
***
found key for : 1
chain [0] = [
[
Version: V1
Subject: CN=Client, OU=Client, O=Client, L=Madrid, ST=Madrid, C=ES
...
Validity: [From: Fri Jan 27 15:09:51 CET 2017,
To: Sat Jan 27 15:09:51 CET 2018]
Issuer: CN=CA, OU=CA, O=The CA, L=Madrid, ST=Madrid, C=ES
...
and that the issuer of this client key matches the certificate requested by the server for client authentication:
*** CertificateRequest
...
Cert Authorities:
<CN=CA, OU=CA, O=The CA, L=Madrid, ST=Madrid, C=ES>
*** ServerHelloDone
Warning: no suitable certificate found - continuing without client authentication
*** Certificate chain
<Empty>
***
but as you can see there is no client certificate found, even though the trace above shows that the required certificate was in fact loaded.
An speculative explanation would be that somehow play-ws is using different keystores when loading my client certificate and after
when talking to the server, and the latter is empty. Let me know if I should file this as an issue.
Regards,
David