mirror of https://github.com/shred/acme4j
Only throw AcmeRetryAfterException when there is an actual retry date
parent
ef7070a3b6
commit
3d6342a917
|
@ -188,10 +188,12 @@ public class Authorization extends AcmeResource {
|
||||||
|
|
||||||
if (rc == HttpURLConnection.HTTP_ACCEPTED) {
|
if (rc == HttpURLConnection.HTTP_ACCEPTED) {
|
||||||
Date retryAfter = conn.getRetryAfterHeader();
|
Date retryAfter = conn.getRetryAfterHeader();
|
||||||
|
if (retryAfter != null) {
|
||||||
throw new AcmeRetryAfterException(
|
throw new AcmeRetryAfterException(
|
||||||
"authorization is not completed yet",
|
"authorization is not completed yet",
|
||||||
retryAfter);
|
retryAfter);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
throw new AcmeNetworkException(ex);
|
throw new AcmeNetworkException(ex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,10 +93,12 @@ public class Certificate extends AcmeResource {
|
||||||
int rc = conn.sendRequest(getLocation());
|
int rc = conn.sendRequest(getLocation());
|
||||||
if (rc == HttpURLConnection.HTTP_ACCEPTED) {
|
if (rc == HttpURLConnection.HTTP_ACCEPTED) {
|
||||||
Date retryAfter = conn.getRetryAfterHeader();
|
Date retryAfter = conn.getRetryAfterHeader();
|
||||||
|
if (retryAfter != null) {
|
||||||
throw new AcmeRetryAfterException(
|
throw new AcmeRetryAfterException(
|
||||||
"certificate is not available for download yet",
|
"certificate is not available for download yet",
|
||||||
retryAfter);
|
retryAfter);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (rc != HttpURLConnection.HTTP_OK) {
|
if (rc != HttpURLConnection.HTTP_OK) {
|
||||||
conn.throwAcmeException();
|
conn.throwAcmeException();
|
||||||
|
|
Loading…
Reference in New Issue