Problem - Expired certificate is not rejected
Hi,
I have a client-server code that use certificates to authenticate (the client authenticate the server).
In one case when I check the server certificate in the usual way (init the trust_manager_list)
TrustManagerFactory trust_factory = TrustManagerFactory.getInstance(DEFAULT_SSL_CONNECTION_TRUST_MGR_ALGORITHM);
trust_factory.init(tmp_key_store);
trust_manager_list = trust_factory.getTrustManagers();
The server certificate pass the check.
When I perform my own implementation (that only check for validitiy only) I get an error:
X509Certificate tmp_cert =null;
for (int i = 0 ; i < chain.length ; i++ )
{
tmp_cert = chain[i];
try
{
tmp_cert.checkValidity();
}
catch(CertificateExpiredException exp)
{
s_logger.fatal(exp.getMessage());
throw exp;
}
catch(CertificateNotYetValidException exp)
{
s_logger.fatal(exp.getMessage());
throw exp;
}
}
Why isthis is happening?! am I missing something?
Thanx,
LT

