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();