use of org.shredzone.acme4j.Session in project webpieces by deanhiller.
the class AcmeClientProxy method placeOrder.
// TODO: Put the remote request INTO a different pool to not hold up the webserver main
// threadpool so only synchronous requests will hold up synchronous requests
/**
* @return The list of challenges with tokens to create webpages for that remote end will call to verify we own the domain
*/
public XFuture<ProxyOrder> placeOrder(URL accountUrl, KeyPair accountKeyPair) {
try {
log.info("reestablish account from location=" + accountUrl + " and keypair");
Session session = new Session("acme://letsencrypt.org/staging");
Login login = session.login(accountUrl, accountKeyPair);
Account account = login.getAccount();
log.info("create an order");
String domainTemp = "something.com";
Order order = account.newOrder().domain(domainTemp).create();
checkAuthStatii(order);
List<ProxyAuthorization> auths = new ArrayList<>();
for (Authorization auth : order.getAuthorizations()) auths.add(new ProxyAuthorization(auth));
return XFuture.completedFuture(new ProxyOrder(order, auths));
} catch (AcmeException e) {
throw SneakyThrow.sneak(e);
}
}
Aggregations