In my Java application, I need to connect to the same host using SSL, but using a different certificate each time. The reason I need to use different certificates is that t
Implementations may have changed a lot since the question was asked. My understanding is that the server will send trusted issues to the client:
Found trusted certificate:
[
[
Version: V3
Subject: CN=localhost, OU=Spring, O=Pivotal, L=Holualoa, ST=HI, C=US
Signature Algorithm: SHA256withRSA, OID = 1.2.840.113549.1.1.11
Then the client will receive a CertificateRequest:
*** CertificateRequest
Cert Types: RSA, DSS, ECDSA
Supported Signature Algorithms: SHA512withECDSA, SHA512withRSA, SHA384withECDSA, SHA384withRSA, SHA256withECDSA, SHA256withRSA, SHA256withDSA, SHA224withECDSA, SHA224withRSA, SHA224withDSA, SHA1withECDSA, SHA1withRSA, SHA1withDSA
Cert Authorities:
Then the client will scan its local keystore with issuers:
Set certIssuers =
credentials.getIssuerX500Principals();
for (int i = 0; i < x500Issuers.length; i++) {
if (certIssuers.contains(issuers[i])) {
aliases.add(alias);
if (debug != null && Debug.isOn("keymanager")) {
System.out.println("matching alias: " + alias);
}
break;
}
If found, it will use that certificate.