public final class HttpClientSupport extends Object
HttpClient and related components.| Modifier | Constructor and Description |
|---|---|
private |
HttpClientSupport()
Constructor to prevent instantiation.
|
| Modifier and Type | Method and Description |
|---|---|
static SSLConnectionSocketFactory |
buildNoTrustSSLConnectionSocketFactory()
Deprecated.
use instead
buildNoTrustTLSSocketFactory() |
static LayeredConnectionSocketFactory |
buildNoTrustTLSSocketFactory()
Build a TLS-capable instance of
LayeredConnectionSocketFactory which accepts all peer certificates
and performs no hostname verification. |
static X509TrustManager |
buildNoTrustX509TrustManager()
Build an instance of
X509TrustManager which trusts all certificates. |
static SSLConnectionSocketFactory |
buildStrictSSLConnectionSocketFactory()
Deprecated.
use instead
buildStrictTLSSocketFactory() |
static LayeredConnectionSocketFactory |
buildStrictTLSSocketFactory()
Build an instance of TLS-capable
LayeredConnectionSocketFactory which uses
the standard JSSE default SSLContext and which performs
strict hostname verification. |
static String |
toString(org.apache.http.HttpEntity entity,
Charset defaultCharset,
int maxLength)
Get the entity content as a String, using the provided default character set
if none is found in the entity.
|
static String |
toString(org.apache.http.HttpEntity entity,
int maxLength)
Read the contents of an entity and return it as a String.
|
static String |
toString(org.apache.http.HttpEntity entity,
String defaultCharset,
int maxLength)
Get the entity content as a String, using the provided default character set
if none is found in the entity.
|
private HttpClientSupport()
@Nonnull public static LayeredConnectionSocketFactory buildStrictTLSSocketFactory()
LayeredConnectionSocketFactory which uses
the standard JSSE default SSLContext and which performs
strict hostname verification.@Nonnull public static LayeredConnectionSocketFactory buildNoTrustTLSSocketFactory()
LayeredConnectionSocketFactory which accepts all peer certificates
and performs no hostname verification.@Deprecated @Nonnull public static SSLConnectionSocketFactory buildStrictSSLConnectionSocketFactory()
buildStrictTLSSocketFactory()SSLConnectionSocketFactory which uses
the standard HttpClient default SSLContext and which uses
a strict hostname verifier SSLConnectionSocketFactory.STRICT_HOSTNAME_VERIFIER.@Deprecated @Nonnull public static SSLConnectionSocketFactory buildNoTrustSSLConnectionSocketFactory()
buildNoTrustTLSSocketFactory()SSLConnectionSocketFactory which accepts all peer certificates
and performs no hostname verification.@Nonnull public static X509TrustManager buildNoTrustX509TrustManager()
X509TrustManager which trusts all certificates.@Nullable public static String toString(@Nonnull org.apache.http.HttpEntity entity, @Nullable Charset defaultCharset, int maxLength) throws IOException, org.apache.http.ParseException
If defaultCharset is null, the default "ISO-8859-1" is used.
entity - must not be nulldefaultCharset - character set to be applied if none found in the entitymaxLength - limit on size of contentHttpEntity.getContent() is null.org.apache.http.ParseException - if header elements cannot be parsedIOException - if an error occurs reading the input stream, or the size exceeds limitsUnsupportedCharsetException - when the content's charset is not available@Nullable public static String toString(@Nonnull org.apache.http.HttpEntity entity, @Nullable String defaultCharset, int maxLength) throws IOException, org.apache.http.ParseException
entity - must not be nulldefaultCharset - character set to be applied if none found in the entitymaxLength - limit on size of contentHttpEntity.getContent() is null.org.apache.http.ParseException - if header elements cannot be parsedIOException - if an error occurs reading the input stream, or the size exceeds limitsUnsupportedCharsetException - when the content's charset is not available@Nullable public static String toString(@Nonnull org.apache.http.HttpEntity entity, int maxLength) throws IOException, org.apache.http.ParseException
entity - the entity to convert to a string; must not be nullmaxLength - limit on size of contentHttpEntity.getContent() is null.org.apache.http.ParseException - if header elements cannot be parsedIOException - if an error occurs reading the input stream, or the size exceeds limitsUnsupportedCharsetException - when the content's charset is not availableCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.