How to get server certificate chain then verify it's valid and trusted in Java

后端 未结 3 1833
时光取名叫无心
时光取名叫无心 2020-11-30 04:22

I need to create an Https connection with a remote server then retrieve and verify the certificate.

I have established the connection fine:

try {  
          


        
3条回答
  •  孤城傲影
    2020-11-30 04:38

    Quick googling brought me to this example using BouncyCastle. I think it better answers the question. http://www.nakov.com/blog/2009/12/01/x509-certificate-validation-in-java-build-and-verify-chain-and-verify-clr-with-bouncy-castle/

提交回复
热议问题