문제

Here is a sample code I am referring to. https://sites.google.com/site/ssljavaguide/example-code/2-way-ssl

Can I not set the keystore-related properties and wait for some exception to be thrown and then depending upon the occurrence of exception decide whether it is a 1-way or 2-way ssl connection?

Apologies if the question seems stupid.

도움이 되었습니까?

해결책

It's up to the server to request a client certificate (the client cannot send it if it's not requested).

Your client keystore will only be used if the server makes such a request. Setting a keystore when no client certificate is requested is not a problem: it just won't be used. The side effect is that the client will send a suitable cert whenever it's requested. If you need a bit more control, you'll need a custom KeyManager.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top