Some warning message to confirm that certificate authentication really took place

This commit is contained in:
Trustin Lee 2010-01-25 11:50:08 +00:00
parent a8eda60857
commit e8f3c3534c

View File

@ -43,15 +43,20 @@ public class SecureChatTrustManagerFactory extends TrustManagerFactorySpi {
}
public void checkClientTrusted(
X509Certificate[] arg0, String arg1) throws CertificateException {
X509Certificate[] chain, String authType) throws CertificateException {
// Always trust - it is an example.
// You should do something in the real world.
// You will reach here only if you enabled client certificate auth.
System.err.println(
"UNKNOWN CLIENT CERTIFICATE: " + chain[0].getSubjectDN());
}
public void checkServerTrusted(
X509Certificate[] arg0, String arg1) throws CertificateException {
X509Certificate[] chain, String authType) throws CertificateException {
// Always trust - it is an example.
// You should do something in the real world.
System.err.println(
"UNKNOWN SERVER CERTIFICATE: " + chain[0].getSubjectDN());
}
};