<div dir="ltr">Hello,<div>I'm attempting to use the s_client command on Windows 10 to connect to a secure server (<a href="http://client.badssl.com/" target="_blank">client.badssl.com</a>) that requires client authentication. When I run the following command...</div><div><br></div><div>echo -e 'GET / HTTP/1.1\r\nHost: <a href="http://client.badssl.com/" target="_blank">client.badssl.com</a>\r\n\r\n' | ./dist/bin/openssl.exe s_client -ign_eof -verifyCAfile ca-bundle.crt -connect <a href="http://client.badssl.com:443/" target="_blank">client.badssl.com:443</a><br></div><div><br></div><div>...server verification succeeds, but I get a 400 error: "No required SSL certificate was sent"</div><div><br></div><div>So I tried using the CAPI engine to handle ssl client authentication:</div><div><div>echo -e 'GET / HTTP/1.1\r\nHost: <a href="http://client.badssl.com/" target="_blank">client.badssl.com</a>\r\n\r\n' | ./dist/bin/openssl.exe s_client -ign_eof -verifyCAfile ca-bundle.crt -ssl_client_engine capi -connect <a href="http://client.badssl.com:443/" target="_blank">client.badssl.com:443</a><br></div><div><br></div><div>But now the failure occurs even earlier:</div><div><font face="monospace">No client certificate CA names sent<br>Peer signing digest: SHA512<br>Peer signature type: RSA<br>Server Temp Key: ECDH, P-256, 256 bits<br>---<br>SSL handshake has read 3310 bytes and written 330 bytes<br>Verification error: certificate signature failure</font><br></div><div><font face="monospace"><br></font></div><div>It seems that the CAPI engine is breaking the server verification somehow.<br></div><div>Note that the only reason I'm using the ca-bundle.crt is that I couldn't figure out how to get CAPI to load the Windows "ROOT" certificate store, which contains the requisite CA certs. Ideally, server authentication would use the CA certs in the Windows "ROOT" store, and client authentication would use the certs in the Windows "MY" store, but CAPI doesn't appear to be loading either one.</div><div><br></div><div>Note: I can use the openssl "engine" command to get CAPI to list the certs in a store by name: e.g.,</div><div>./dist/bin/openssl.exe engine -t -post store_name:ROOT -post list_certs capi<br></div><div><br></div><div>But this doesn't help much if the engine doesn't load them automatically when a client connection is made with s_client. I was under the impression that CAPI would automatically use the Windows cert stores for client and server authentication. Have I misunderstood the goal of the CAPI engine?</div><div><br></div><div>Thanks,</div><div>Brett S.</div></div></div>