Some warning message to confirm that certificate authentication really took place
This commit is contained in:
parent
a8eda60857
commit
e8f3c3534c
@ -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());
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user