0

Here I need to verify the SSL certificates for https websites with the root certificate. I have tried extremely lot but it could not be done yet. If anyone have any Idea to write such a code in java that could verify the Certs with the root cert. Mean that I have to check the certificate hierarchy signature validation for particular certs.

Thanks....

EpicPandaForce
  • 79,669
  • 27
  • 256
  • 428
  • 1
    I'm pretty sure you have to define your TrustManager for an SSLContext and SSLConnectionFactory, but I'm not sure about the code. Isn't this already done for you by default? – EpicPandaForce Mar 18 '16 at 08:29

1 Answers1

0

You need all root and sub root certs for validation. There is two different technologies; CLR and OCSP. OCSP is new one but some certificates support it. You need some basic check for validate certifcate (also there are more rules):

  1. Date is valid,
  2. Certificate has ssl encription support, domain, etc,
  3. Certificate issuer is correct,
  4. Certifate rewoked or cancalled (with CRL or OCSP)

Java has own library for this, example: How to get server certificate chain then verify it's valid and trusted in Java

Community
  • 1
  • 1
mkysoft
  • 5,392
  • 1
  • 21
  • 30