Skip to content

Commit

Permalink
Also accept 202-Accepted for registration and authorization deactivation
Browse files Browse the repository at this point in the history
  • Loading branch information
shred committed Dec 5, 2016
1 parent 033e74e commit a74a0f0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void deactivate() throws AcmeException {
claims.put("status", "deactivated");

int rc = conn.sendSignedRequest(getLocation(), claims, getSession());
if (rc != HttpURLConnection.HTTP_OK) {
if (rc != HttpURLConnection.HTTP_OK && rc != HttpURLConnection.HTTP_ACCEPTED) {
conn.throwAcmeException();
}
} catch (IOException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public void deactivate() throws AcmeException {
claims.put("status", "deactivated");

int rc = conn.sendSignedRequest(getLocation(), claims, getSession());
if (rc != HttpURLConnection.HTTP_OK) {
if (rc != HttpURLConnection.HTTP_OK && rc != HttpURLConnection.HTTP_ACCEPTED) {
conn.throwAcmeException();
}
} catch (IOException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public int sendSignedRequest(URI uri, ClaimBuilder claims, Session session) {
assertThat(claimMap.get("status"), is((Object) "deactivated"));
assertThat(uri, is(locationUri));
assertThat(session, is(notNullValue()));
return HttpURLConnection.HTTP_OK;
return HttpURLConnection.HTTP_ACCEPTED;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public int sendSignedRequest(URI uri, ClaimBuilder claims, Session session) {
assertThat(claimMap.get("status"), is((Object) "deactivated"));
assertThat(uri, is(locationUri));
assertThat(session, is(notNullValue()));
return HttpURLConnection.HTTP_OK;
return HttpURLConnection.HTTP_ACCEPTED;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ public void fetchCertificate(Collection<String> domains) throws IOException, Acm

// Revoke the certificate (uncomment if needed...)
// certificate.revoke();

// Deactivate the registration (uncomment if needed...)
// reg.deactivate();
}

/**
Expand Down

0 comments on commit a74a0f0

Please sign in to comment.