Only throw AcmeRetryAfterException when there is an actual retry date

pull/30/head
Richard Körber 2016-07-27 23:29:56 +02:00
parent ef7070a3b6
commit 3d6342a917
2 changed files with 10 additions and 6 deletions

View File

@ -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);
} }

View File

@ -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();