@Override
  public void checkServerTrusted(final X509Certificate[] chain, String authType) throws CertificateException {
    withCalculatedCertificateStrategy(strategyWithReason -> {
      boolean askUser = strategyWithReason.getStrategy() == UntrustedCertificateStrategy.ASK_USER;
      String askUserReason = strategyWithReason.getReason();
      checkServerTrusted(chain, authType, new CertificateConfirmationParameters(askUser, true, null, null, askUserReason));
    });
  }
@Override
  public void checkServerTrusted(final X509Certificate[] chain, String authType)