For a deeper look into our World Check One API, look into:

Overview |  Quickstart |  Documentation |  Downloads

question

Upvotes
Accepted
1 0 1 1

Does REST Template internally validates the certificate's expiry?

Trying to find out the code in REST Template which actually does the certification validation over the certificate received in response to client request. I know that certificate.checkValidity() is the method where all certificate related validations takes place. But I am not able to find anything concrete which tells which all validations it performs. Could some please share and confirm these validations either in the form of some official documentation or REST Template official documentation?


String worldcheckURL= “ thomsonreuters API URL” ;
URL url = new URL(worldcheckURL);
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
X509Certificate[] certs = (X509Certificate[]) connection.getServerCertificates();
X509Certificate certificate = certs[0];
certificate.getVersion());
certificate.getNotAfter())
certificate.checkValidity();
world-checkworld-check-onesslcertificate
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
1.2k 4 1 2

@dsaini86


I would like to know is there a specific reason to check the validity again after the TLS handshake?

If the certs are expired you won't be able to consume the API in the first place s was just wondering why the approach of validating again post successful handshake?


If your intention is to know till when the certs are valid for? rest assured we will be updating our certs before they expire.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1.2k 4 1 2

@dsaini86

I have also raised a ticket with our support who will soon reach out to you and assist.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.