What is a recommended way how to implement checkServerTrusted
method for X509TrustManager
? I need to use reimplement that for ssl pinning, but I can see just this implementation all the time:
public void checkServerTrusted(X509Certificate[] certificates, String authType)
throws CertificateException {
if ((certificates != null) && (certificates.length == 1)) {
certificates[0].checkValidity();
} else {
standardTrustManager.checkServerTrusted(certificates, authType);
}
}
taken from this response. However it seems to be wrong in my opinion. It only checks whether certificate is valid (not expired), but nothing else.
Is there any implementation you could recommend me, please?