mirror of https://github.com/shred/acme4j
Also accept 202-Accepted for registration and authorization deactivation
parent
033e74ea7a
commit
a74a0f0531
|
@ -210,7 +210,7 @@ public class Authorization extends AcmeResource {
|
||||||
claims.put("status", "deactivated");
|
claims.put("status", "deactivated");
|
||||||
|
|
||||||
int rc = conn.sendSignedRequest(getLocation(), claims, getSession());
|
int rc = conn.sendSignedRequest(getLocation(), claims, getSession());
|
||||||
if (rc != HttpURLConnection.HTTP_OK) {
|
if (rc != HttpURLConnection.HTTP_OK && rc != HttpURLConnection.HTTP_ACCEPTED) {
|
||||||
conn.throwAcmeException();
|
conn.throwAcmeException();
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|
|
@ -342,7 +342,7 @@ public class Registration extends AcmeResource {
|
||||||
claims.put("status", "deactivated");
|
claims.put("status", "deactivated");
|
||||||
|
|
||||||
int rc = conn.sendSignedRequest(getLocation(), claims, getSession());
|
int rc = conn.sendSignedRequest(getLocation(), claims, getSession());
|
||||||
if (rc != HttpURLConnection.HTTP_OK) {
|
if (rc != HttpURLConnection.HTTP_OK && rc != HttpURLConnection.HTTP_ACCEPTED) {
|
||||||
conn.throwAcmeException();
|
conn.throwAcmeException();
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|
|
@ -271,7 +271,7 @@ public class AuthorizationTest {
|
||||||
assertThat(claimMap.get("status"), is((Object) "deactivated"));
|
assertThat(claimMap.get("status"), is((Object) "deactivated"));
|
||||||
assertThat(uri, is(locationUri));
|
assertThat(uri, is(locationUri));
|
||||||
assertThat(session, is(notNullValue()));
|
assertThat(session, is(notNullValue()));
|
||||||
return HttpURLConnection.HTTP_OK;
|
return HttpURLConnection.HTTP_ACCEPTED;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -440,7 +440,7 @@ public class RegistrationTest {
|
||||||
assertThat(claimMap.get("status"), is((Object) "deactivated"));
|
assertThat(claimMap.get("status"), is((Object) "deactivated"));
|
||||||
assertThat(uri, is(locationUri));
|
assertThat(uri, is(locationUri));
|
||||||
assertThat(session, is(notNullValue()));
|
assertThat(session, is(notNullValue()));
|
||||||
return HttpURLConnection.HTTP_OK;
|
return HttpURLConnection.HTTP_ACCEPTED;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -201,6 +201,9 @@ public class ClientTest {
|
||||||
|
|
||||||
// Revoke the certificate (uncomment if needed...)
|
// Revoke the certificate (uncomment if needed...)
|
||||||
// certificate.revoke();
|
// certificate.revoke();
|
||||||
|
|
||||||
|
// Deactivate the registration (uncomment if needed...)
|
||||||
|
// reg.deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue