+ /**
+ * X509TrustManager that trusts any certificate
+ *
+ * @author Marius Gavrilescu
+ */
+ private static final class TotallyInsecureTrustManager implements X509TrustManager {
+ @Override
+ public @Nullable X509Certificate[] getAcceptedIssuers() {
+ return new X509Certificate[0];
+ }
+
+ @Override
+ public void checkServerTrusted(final @Nullable X509Certificate[] chain, final @Nullable String authType)
+ throws CertificateException {
+ //do nothing
+ }
+
+ @Override
+ public void checkClientTrusted(final @Nullable X509Certificate[] chain, final @Nullable String authType)
+ throws CertificateException {
+ //do nothing
+ }
+ }
+