/** * Creates a self-signed {@link X509Certificate} that can be used for the * {@link TlsAlpn01Challenge}. The certificate is valid for 7 days. * * @param keypair * A domain {@link KeyPair} to be used for the challenge * @param subject * The subject (domain name) that is to be validated * @param acmeValidation * The value that is returned by * {@link TlsAlpn01Challenge#getAcmeValidation()} * @return Created certificate * @since 2.1 * @deprecated Use {@link #createTlsAlpn01Certificate(KeyPair, Identifier, byte[])} * and {@link Identifier#dns(String)}. If an {@link Authorization} * instance is at hand, you can also use * {@link Authorization#getIdentifier()}. */ @Deprecated public static X509Certificate createTlsAlpn01Certificate(KeyPair keypair, String subject, byte[] acmeValidation) throws IOException { Objects.requireNonNull(subject, "subject"); return createTlsAlpn01Certificate(keypair, Identifier.dns(subject), acmeValidation); }
public synchronized void start() { if (executor != null) { return; } executor = Executors.newScheduledThreadPool(1, new NamingThreadFactory("acme-client")); if (isSSLEnabled()) { try (FileInputStream fis = new FileInputStream(new File(basepath, "domain-chain.crt"))) { X509Certificate certificate = CertificateUtils.readX509Certificate(fis); scheduleRenew(certificate); } catch (IOException e) { LOG.error("unable to load certificate for renewal", e); } } }
CertificateUtils.writeX509CertificateChain(fw, cert, chain);
csr = CertificateUtils.readCSR(fis).getEncoded(); } catch (Exception e) { LOG.error("unable to load csr. trying to create new", e);
CertificateUtils.writeX509CertificateChain(fw, cert, chain); } catch (IOException e) { String message = "unable to save certificate";
/** * Creates a self-signed {@link X509Certificate} that can be used for the * {@link TlsAlpn01Challenge}. The certificate is valid for 7 days. * * @param keypair * A domain {@link KeyPair} to be used for the challenge * @param subject * The subject (domain name) that is to be validated * @param acmeValidation * The value that is returned by * {@link TlsAlpn01Challenge#getAcmeValidation()} * @return Created certificate * @since 2.1 * @deprecated Use {@link #createTlsAlpn01Certificate(KeyPair, Identifier, byte[])} * and {@link Identifier#dns(String)}. If an {@link Authorization} * instance is at hand, you can also use * {@link Authorization#getIdentifier()}. */ @Deprecated public static X509Certificate createTlsAlpn01Certificate(KeyPair keypair, String subject, byte[] acmeValidation) throws IOException { Objects.requireNonNull(subject, "subject"); return createTlsAlpn01Certificate(keypair, Identifier.dns(subject), acmeValidation); }