LOG.debug("downloadChain");
List<X509Certificate> certChain = new ArrayList<>();
URI link = chainCertUri;
while (link != null && certChain.size() < MAX_CHAIN_LENGTH) {
try (Connection conn = getSession().provider().connect()) {
<BUG>int rc = conn.sendRequest(chainCertUri, getSession());
if (rc != HttpURLConnection.HTTP_OK) {
conn.throwAcmeException();
}</BUG>
certChain.add(conn.readCertificate());

LOG.debug("downloadChain");
List<X509Certificate> certChain = new ArrayList<>();
URI link = chainCertUri;
while (link != null && certChain.size() < MAX_CHAIN_LENGTH) {
try (Connection conn = getSession().provider().connect()) {
conn.sendRequest(chainCertUri, getSession());
conn.accept(HttpURLConnection.HTTP_OK);
certChain.add(conn.readCertificate());
