@Override
    public void fetchCertificate(final Collection<String> domains) throws Exception {
        val acme = casProperties.getAcme();

        val userKeyPair = loadOrCreateUserKeyPair();
        val domainKeyPair = loadOrCreateDomainKeyPair();

        val csrb = new CSRBuilder();
        csrb.addDomains(domains);
        csrb.sign(domainKeyPair);
        try (val out = new FileWriter(acme.getDomainCsr().getLocation().getFile(), StandardCharsets.UTF_8)) {
            csrb.write(out);
        }

        val session = new Session(acme.getServerUrl());
        val acct = findOrRegisterAccount(session, userKeyPair);

        val order = getCertificateOrder(domains, csrb, acct);

        fetchStatusAndUpdate(order, order::getStatus);

        val certificate = order.getCertificate();

        LOGGER.info("The certificate for domains [{}] has been successfully generated.", domains);
        LOGGER.info("Certificate URL is [{}]", Objects.requireNonNull(certificate).getLocation());

        try (val fw = new FileWriter(acme.getDomainChain().getLocation().getFile(), StandardCharsets.UTF_8)) {
            certificate.writeCertificate(fw);
        }
        LOGGER.info("Configure the web server to use [{}] and [{}] for domains [{}]",
            acme.getDomainKey().getLocation(), acme.getDomainChain().getLocation(), acme.getDomains());
    }
Finds your {@link Account} at the ACME server. It will be found by your user's
public key. If your key is not known to the server yet, a new account will be
created.

@param session {@link Session} to bind with
@return {@link Account}
support/cas-server-support-acme/src/main/java/org/apereo/cas/acme/DefaultAcmeCertificateManager.java