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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigure(HttpURLConnection conn, NetworkSettings settings) Configures the newHttpURLConnection.static StringReturns the default User-Agent to be used.openConnection(URL url, NetworkSettings settings) Opens aHttpURLConnectionto the givenURL.
-
Constructor Details
-
HttpConnector
public HttpConnector()
-
-
Method Details
-
defaultUserAgent
Returns the default User-Agent to be used.- Returns:
- User-Agent
-
openConnection
Opens aHttpURLConnectionto the givenURL.- Parameters:
url-URLto connect tosettings-NetworkSettingsto be used- Returns:
HttpURLConnectionconnected to theURL- Throws:
IOException
-
configure
Configures the newHttpURLConnection.The
HttpURLConnectionis already preconfigured with a reasonable timeout, disabled caches and a User-Agent header. Subclasses can override this method to change the configuration.- Parameters:
conn-HttpURLConnectionto configure.settings-NetworkSettingswith settings to be used
-