如何解决Java-未找到合适的证书-未经客户端身份验证即可继续
我试图创建一个简单的Restful程序来从Java中调用API。它只会是独立的Java程序。密钥上没有问题,因为我可以直接通过soapUI调用API。
Request request = new Request();
.....
String jsonRequest = gsonObj.toJson(request);
String url="..../ethoca-rest/rest/api/v1/transactions/batch";
System.setProperty("javax.net.ssl.trustStore","C:\\cacerts");
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
System.setProperty("javax.net.ssl.keyStore","C:\\key.pfx");
System.setProperty("javax.net.ssl.keyStorePassword","1234");
System.setProperty("javax.net.ssl.keyStoreType","PKCS12");
System.setProperty("javax.net.debug","ssl,handshake");
HttpClient client = HttpClients.createDefault();
HttpPost httpRequest = new HttpPost(url);
httpRequest.setEntity(new StringEntity(gsonObj.toJson(request),ContentType.APPLICATION_JSON));
HttpResponse response = client.execute(httpRequest);
下面是SSL日志。
*** CertificateRequest
Cert Types: RSA,DSS,ECDSA
Supported Signature Algorithms: SHA512withRSA,Unknown (hash:0x6,signature:0x2),SHA512withECDSA,SHA384withRSA,Unknown (hash:0x5,SHA384withECDSA,SHA256withRSA,SHA256withDSA,SHA256withECDSA,Unknown (hash:0x3,signature:0x1),signature:0x3),SHA1withRSA,SHA1withDSA,SHA1withECDSA
Cert Authorities:
<Empty>
update handshake state: unknown[13]
upcoming handshake states: server_hello_done[14]
upcoming handshake states: client certificate[11](optional)
upcoming handshake states: client_key_exchange[16]
upcoming handshake states: certificate_verify[15](optional)
upcoming handshake states: client change_cipher_spec[-1]
upcoming handshake states: client finished[20]
upcoming handshake states: server change_cipher_spec[-1]
upcoming handshake states: server finished[20]
check handshake state: server_hello_done[14]
update handshake state: server_hello_done[14]
upcoming handshake states: client certificate[11](optional)
upcoming handshake states: client_key_exchange[16]
upcoming handshake states: certificate_verify[15](optional)
upcoming handshake states: client change_cipher_spec[-1]
upcoming handshake states: client finished[20]
upcoming handshake states: server change_cipher_spec[-1]
upcoming handshake states: server finished[20]
*** ServerHelloDone
Warning: no suitable certificate found - continuing without client authentication
*** Certificate chain
<Empty>
***
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。