use of lucee.runtime.net.http.CertificateInstaller in project Lucee by lucee.
the class Admin method getSSLCertificate.
public static Query getSSLCertificate(Config config, String host, int port) throws PageException {
Resource cacerts = config.getSecurityDirectory();
CertificateInstaller installer;
try {
installer = new CertificateInstaller(cacerts, host, port);
} catch (Exception e) {
throw Caster.toPageException(e);
}
X509Certificate[] certs = installer.getCertificates();
X509Certificate cert;
Query qry = new QueryImpl(new String[] { "subject", "issuer" }, certs.length, "certificates");
for (int i = 0; i < certs.length; i++) {
cert = certs[i];
qry.setAtEL("subject", i + 1, cert.getSubjectDN().getName());
qry.setAtEL("issuer", i + 1, cert.getIssuerDN().getName());
}
return qry;
}
use of lucee.runtime.net.http.CertificateInstaller in project Lucee by lucee.
the class Admin method updateSSLCertificate.
public static void updateSSLCertificate(Config config, String host, int port) throws PageException {
Resource cacerts = config.getSecurityDirectory();
try {
CertificateInstaller installer = new CertificateInstaller(cacerts, host, port);
installer.installAll();
} catch (Exception e) {
throw Caster.toPageException(e);
}
}
Aggregations