mirror of https://github.com/shred/acme4j
commit
b9f9e96d32
|
@ -106,11 +106,15 @@ public class DefaultConnection implements Connection {
|
|||
|
||||
URL newNonceUrl = session.resourceUrl(Resource.NEW_NONCE);
|
||||
|
||||
LOG.debug("HEAD {}", newNonceUrl);
|
||||
|
||||
conn = httpConnector.openConnection(newNonceUrl, session.getProxy());
|
||||
conn.setRequestMethod("HEAD");
|
||||
conn.setRequestProperty(ACCEPT_LANGUAGE_HEADER, session.getLocale().toLanguageTag());
|
||||
conn.connect();
|
||||
|
||||
logHeaders();
|
||||
|
||||
int rc = conn.getResponseCode();
|
||||
if (rc != HttpURLConnection.HTTP_OK && rc != HttpURLConnection.HTTP_NO_CONTENT) {
|
||||
throwAcmeException();
|
||||
|
|
|
@ -188,6 +188,7 @@ public class DefaultConnectionTest {
|
|||
verify(mockUrlConnection, atLeastOnce()).connect();
|
||||
verify(mockUrlConnection, atLeastOnce()).getResponseCode();
|
||||
verify(mockUrlConnection, atLeastOnce()).getHeaderField("Replay-Nonce");
|
||||
verify(mockUrlConnection, atLeastOnce()).getHeaderFields();
|
||||
verifyNoMoreInteractions(mockUrlConnection);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue