public final class HttpsURLConnectionUtil extends Object
HttpsURLConnection
.
This class is thread-safe.
Modifier and Type | Field and Description |
---|---|
static HostnameVerifier |
LAX_HOSTNAME_VERIFIER |
static SSLSocketFactory |
LAX_SSL_SOCKET_FACTORY |
static HostnameVerifier |
STRICT_HOSTNAME_VERIFIER |
static SSLSocketFactory |
STRICT_SSL_SOCKET_FACTORY |
Modifier and Type | Method and Description |
---|---|
static boolean |
getValidateServer()
Returns
true if the validation of the certificates of
HTTPS servers is turned on; false otherwise. |
static void |
setValidateServer(boolean validate)
Specifies whether validation of the certificates of HTTPS servers is
turned on.
|
public static final SSLSocketFactory STRICT_SSL_SOCKET_FACTORY
public static SSLSocketFactory LAX_SSL_SOCKET_FACTORY
public static final HostnameVerifier STRICT_HOSTNAME_VERIFIER
public static final HostnameVerifier LAX_HOSTNAME_VERIFIER
public static void setValidateServer(boolean validate)
When the validation is turned off, there is no validation at all. For example, the following cases are not rejected:
getValidateServer()
public static boolean getValidateServer()
true
if the validation of the certificates of
HTTPS servers is turned on; false
otherwise.setValidateServer(boolean)