java.lang.Object
org.shredzone.acme4j.connector.HttpConnector
A generic HTTP connector. It connects to the given URL with a 10 seconds connection and
read timeout.
Subclasses may reconfigure the HttpURLConnection
and pin it to a concrete SSL
certificate.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
configure
(HttpURLConnection conn, NetworkSettings settings) Configures the newHttpURLConnection
.static String
Returns the default User-Agent to be used.openConnection
(URL url, NetworkSettings settings) Opens aHttpURLConnection
to the givenURL
.
-
Constructor Details
-
HttpConnector
public HttpConnector()
-
-
Method Details
-
defaultUserAgent
Returns the default User-Agent to be used.- Returns:
- User-Agent
-
openConnection
Opens aHttpURLConnection
to the givenURL
.- Parameters:
url
-URL
to connect tosettings
-NetworkSettings
to be used- Returns:
HttpURLConnection
connected to theURL
- Throws:
IOException
-
configure
Configures the newHttpURLConnection
.The
HttpURLConnection
is already preconfigured with a reasonable timeout, disabled caches and a User-Agent header. Subclasses can override this method to change the configuration.- Parameters:
conn
-HttpURLConnection
to configure.settings
-NetworkSettings
with settings to be used
-