Class ApacheHc45TransportBuilder
ApacheHc45Transport.
Obtain an instance via ApacheHc45Transport.builder().
See Also:
- Since:
- 9.2.1
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns theApacheHc45Transport.httpClient(CloseableHttpClient value) Sets the underlyingCloseableHttpClientto use.
-
Method Details
-
httpClient
Sets the underlyingCloseableHttpClientto use.If not set, the transport creates its own default clients: one for ordinary requests, and one with a separate connection pool whose connections are all pinned to a policy-allowed address, for SSRF-guard-active
@Remoterequests.A caller-supplied client cannot be given that pin-on-connect pool, so a transport built with one reports
ApacheHc45Transport.supportsUrlPolicy()asfalse , andRestRequestrefuses to send an SSRF-guard-active request through it.The transport takes ownership of the client and will close it when
ApacheHc45Transport.close()is called.A legacy
AbstractHttpClientsubclass (such asDefaultHttpClient) is refused: it never sets the request again just before it is written, so the redirect credential guard cannot strip the credentials HttpClient adds itself (for example the cookie-storeCookie) on a cross-origin redirect. Build the client withHttpClients.- Parameters:
value- The client to use. Must not benull .- Returns:
- This object.
- Throws:
IllegalArgumentException- If the client is anAbstractHttpClient.
-
build
Builds and returns theApacheHc45Transport.- Returns:
- A new instance. Never
null .
-