How to specify outbound certificate alias for HTTPS-calls?

后端 未结 4 668
滥情空心
滥情空心 2021-02-05 07:15

I am calling a webservice that requires client certificate authentication.

If I specify a Java keystore containing a single certificate (the client certificate the servi

4条回答
  •  野性不改
    2021-02-05 08:06

    My impression of the KeyManager is that once it is initialized with the keystore, it uses the alias of the private key entry to find the associated certificate and certificate chain.
    Otherwise,I think it chooses a chain based on the key types and certificate authorities recognized by the host.
    So in your case, your description does not mention a private entry in the keystore, so I will guess that the keymanager chooses the most suitable certificate.
    I am not aware at all of the system property you mention.
    -Try to change the keystore to have a private key and the associated chain
    -Or (not sure if this will work) change the alias of the certificate you want to send to the server to match the subject name of the certificate

提交回复
热议问题