private void checkActive(@NotNull X509Certificate certificate) throws CertificateException {
    boolean isStorageEnabled = myAuthenticationService.getAuthenticationManager().getHostOptions(myRepositoryUrl).isAuthStorageEnabled();
    AcceptResult result = myAuthenticationService.getAuthenticationManager().getProvider()
      .acceptServerAuthentication(myRepositoryUrl, myRealm, certificate, isStorageEnabled);

    switch (result) {
      case ACCEPTED_PERMANENTLY -> {
        // TODO: --trust-server-cert command line key does not allow caching credentials permanently - so permanent caching should be
        // TODO: separately implemented. Try utilizing "Server Certificates" settings for this.
      }
      case ACCEPTED_TEMPORARILY -> {
        // acknowledge() is called in checkServerTrusted()
      }
      case REJECTED -> throw new CertificateException("Server SSL certificate rejected");
    }
  }
private void checkActive(@NotNull X509Certificate certificate)