diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/Certificate.java b/acme4j-client/src/main/java/org/shredzone/acme4j/Certificate.java index d010f219..8f866bb1 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/Certificate.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/Certificate.java @@ -50,8 +50,8 @@ public class Certificate extends AcmeResource { private static final long serialVersionUID = 7381527770159084201L; private static final Logger LOG = LoggerFactory.getLogger(Certificate.class); - private ArrayList certChain = null; - private ArrayList alternates = null; + private ArrayList certChain; + private ArrayList alternates; protected Certificate(Login login, URL certUrl) { super(login, certUrl); diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/connector/DefaultConnection.java b/acme4j-client/src/main/java/org/shredzone/acme4j/connector/DefaultConnection.java index 3560de1e..bd94c7b6 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/connector/DefaultConnection.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/connector/DefaultConnection.java @@ -457,7 +457,7 @@ public class DefaultConnection implements Connection { private void throwAcmeException() throws AcmeException { try { String contentType = AcmeUtils.getContentType(conn.getHeaderField(CONTENT_TYPE_HEADER)); - if (!"application/problem+json".equals(contentType)) { + if (!MIME_JSON_PROBLEM.equals(contentType)) { throw new AcmeException("HTTP " + conn.getResponseCode() + ": " + conn.getResponseMessage()); } diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/provider/pebble/PebbleHttpConnector.java b/acme4j-client/src/main/java/org/shredzone/acme4j/provider/pebble/PebbleHttpConnector.java index 6a0ef451..cff21e12 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/provider/pebble/PebbleHttpConnector.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/provider/pebble/PebbleHttpConnector.java @@ -26,10 +26,8 @@ import java.security.cert.CertificateException; import javax.annotation.ParametersAreNonnullByDefault; import javax.annotation.concurrent.ThreadSafe; -import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManagerFactory; @@ -42,14 +40,6 @@ import org.shredzone.acme4j.connector.HttpConnector; @ParametersAreNonnullByDefault @ThreadSafe public class PebbleHttpConnector extends HttpConnector { - - private static HostnameVerifier ALLOW_ALL_HOSTNAME_VERIFIER = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - private static SSLSocketFactory sslSocketFactory; @Override @@ -58,7 +48,7 @@ public class PebbleHttpConnector extends HttpConnector { if (conn instanceof HttpsURLConnection) { HttpsURLConnection conns = (HttpsURLConnection) conn; conns.setSSLSocketFactory(createSocketFactory()); - conns.setHostnameVerifier(ALLOW_ALL_HOSTNAME_VERIFIER); + conns.setHostnameVerifier((hostname, session) -> true); } return conn; }