@Override
  public AcceptResult acceptServerAuthentication(final Url url,
                                                 String realm,
                                                 final Object certificate,
                                                 final boolean canCache) {
    Ref<AcceptResult> result = Ref.create(AcceptResult.REJECTED);
    Runnable command;
    if (certificate instanceof X509Certificate || certificate instanceof String) {
      command = () -> {
        ServerSSLDialog dialog = certificate instanceof X509Certificate
                                 ? new ServerSSLDialog(myProject, (X509Certificate)certificate, canCache)
                                 : new ServerSSLDialog(myProject, (String)certificate, canCache);
        dialog.show();
        result.set(dialog.getResult());
      };
    } else {
      showOverChangesView(myProject, message("notification.content.unknown.certificate.type.from.url", url.toDecodedString()), MessageType.ERROR);
      return AcceptResult.REJECTED;
    }

    showAndWait(command);
    return result.get();
  }
@Override
  public AcceptResult acceptServerAuthentication(final Url url,
                                                 String realm,
                                                 final Object certificate,
                                                 final boolean canCache)