37 lines
818 B
Plaintext
37 lines
818 B
Plaintext
== How to fix it in Java Cryptographic Extension
|
|
|
|
=== Code examples
|
|
|
|
include::../../common/fix/code-rationale.adoc[]
|
|
|
|
:cert_method_name: X509TrustManager
|
|
|
|
include::../../common/fix/code-rationale-override.adoc[]
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,java]
|
|
----
|
|
class TrustAllManager implements X509TrustManager {
|
|
|
|
@Override
|
|
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { // Noncompliant
|
|
}
|
|
|
|
@Override
|
|
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { // Noncompliant
|
|
}
|
|
|
|
@Override
|
|
public X509Certificate[] getAcceptedIssuers() {
|
|
return null;
|
|
}
|
|
}
|
|
----
|
|
|
|
=== How does this work?
|
|
|
|
include::../../common/fix/validation.adoc[]
|
|
|
|
include::../../common/fix/keytool.adoc[]
|