/** * Creates a new generic {@link Challenge} object. * * @param login * {@link Login} the resource is bound with * @param data * {@link JSON} challenge data */ public Challenge(Login login, JSON data) { super(login, data.get(KEY_URL).asURL()); setJSON(data); }
/** * Creates a new generic {@link Challenge} object. * * @param login * {@link Login} the resource is bound with * @param data * {@link JSON} challenge data */ public Challenge(Login login, JSON data) { super(login, data.get(KEY_URL).asURL()); setJSON(data); }
/** * Triggers this {@link Challenge}. The ACME server is requested to validate the * response. Note that the validation is performed asynchronously by the ACME server. * <p> * If this method is invoked a second time, the ACME server is requested to retry the * validation. This can be useful if the client state has changed, for example after a * firewall rule has been updated. */ public void trigger() throws AcmeException { LOG.debug("trigger"); try (Connection conn = getSession().connect()) { JSONBuilder claims = new JSONBuilder(); prepareResponse(claims); conn.sendSignedRequest(getLocation(), claims, getLogin()); JSON json = conn.readJsonResponse(); if (json != null) { setJSON(json); } } }
/** * Triggers this {@link Challenge}. The ACME server is requested to validate the * response. Note that the validation is performed asynchronously by the ACME server. * <p> * If this method is invoked a second time, the ACME server is requested to retry the * validation. This can be useful if the client state has changed, for example after a * firewall rule has been updated. */ public void trigger() throws AcmeException { LOG.debug("trigger"); try (Connection conn = getSession().connect()) { JSONBuilder claims = new JSONBuilder(); prepareResponse(claims); conn.sendSignedRequest(getLocation(), claims, getLogin()); JSON json = conn.readJsonResponse(); if (json != null) { setJSON(json); } } }