use of com.intellij.util.net.ssl.CertificateManager in project intellij-community by JetBrains.
the class ShowCertificateInfoAction method actionPerformed.
@Override
public void actionPerformed(final AnActionEvent e) {
try {
CertificateManager manager = CertificateManager.getInstance();
List<X509Certificate> certificates = manager.getCustomTrustManager().getCertificates();
if (certificates.isEmpty()) {
Messages.showInfoMessage(String.format("Key store '%s' is empty", manager.getCacertsPath()), "No Certificates Available");
} else {
CertificateWarningDialog dialog = CertificateWarningDialog.createUntrustedCertificateWarning(certificates.get(0));
LOG.debug("Accepted: " + dialog.showAndGet());
}
} catch (Exception logged) {
LOG.error(logged);
}
}
Aggregations