Commit Graph

3485 Commits

Author SHA1 Message Date
Oleg Kalnichevski cf20ea3915 Updated release notes for HttpClient 5.3 release 2023-12-03 09:27:07 +01:00
Oleg Kalnichevski f7ac968aaf HTTPCLIENT-2310: Async Connect exec handler incorrectly pipes CONNECT requests through the main request protocol chain 2023-12-02 11:31:41 +01:00
Oleg Kalnichevski a46c9e5656 Added missing #disconnectEndpoint method to AsyncConnectExec 2023-11-30 13:33:04 +01:00
nfawcett 8a2b0f584a
Improve debug logging around connections that cannot be reused (#515) 2023-11-29 16:50:47 +01:00
Gary Gregory ed1c1d61f2 Use String#isEmpty() 2023-11-28 11:29:24 -05:00
Oleg Kalnichevski efe2598a30 Classic test suits to execute in plain and TLS modes 2023-11-28 11:08:38 +01:00
Oleg Kalnichevski 9ec63474c8 Upgraded HttpCore to version 5.2.4 2023-11-28 09:46:46 +01:00
Cédric Tabin 6d60624cd3 Fixes Invalid Proxy exception when using a SSL client without Proxy 2023-11-23 14:09:34 +01:00
Oleg Kalnichevski 83d603c9d8 SEE OTHER redirect handling fix 2023-11-19 18:47:40 +01:00
dependabot[bot] 3486b47452 Bump com.googlecode.maven-download-plugin:download-maven-plugin
Bumps [com.googlecode.maven-download-plugin:download-maven-plugin](https://github.com/maven-download-plugin/maven-download-plugin) from 1.6.8 to 1.7.1.
- [Release notes](https://github.com/maven-download-plugin/maven-download-plugin/releases)
- [Commits](https://github.com/maven-download-plugin/maven-download-plugin/compare/1.6.8...1.7.1)

---
updated-dependencies:
- dependency-name: com.googlecode.maven-download-plugin:download-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-19 11:46:28 +01:00
dependabot[bot] 82185a3a02 Bump org.junit:junit-bom from 5.9.3 to 5.10.1
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.9.3 to 5.10.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.9.3...r5.10.1)

---
updated-dependencies:
- dependency-name: org.junit:junit-bom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-19 11:45:57 +01:00
Carter Kozak 180d90c847
HTTPCLIENT-2305: SSLConnectionSocketFactory allows socket.connect to be decorated (#499) 2023-11-02 10:19:52 -04:00
HappyHacker123 f78c4ffad1 Change scope of slf4j-api to test. 2023-11-02 14:50:42 +01:00
Marcono1234 19f3922b37 HTTPCLIENT-2302: Add comment to TrustStrategy usage in examples (#492) 2023-10-12 15:34:42 +02:00
Marcono1234 9c83250ab4
Add security warning to TrustStrategy implementations documentation (#490) 2023-10-03 22:14:12 +02:00
Oleg Kalnichevski 19ab1111c7 More consistent handling of OperationTimeoutException in MemcachedHttpCacheStorage 2023-09-29 15:24:37 +02:00
Oleg Kalnichevski 6d1aafaf87 HTTPCLIENT-2300: abstract char message consumers to use UTF-8 by default if a charset has not been explicitly specified by the Content-Type 2023-09-26 16:41:24 +02:00
Oleg Kalnichevski 11c7af28c4 HTTPCLIENT-2299: Socket timeout value set via DefaultManagedHttpClientConnection#setSocketTimeout is not correctly persisted and can be overwritten upon connection activation 2023-09-23 10:55:57 +02:00
Oleg Kalnichevski dbe368983c Upgraded HttpCore to version 5.2.3 2023-09-22 15:53:34 +02:00
Oleg Kalnichevski aa5a7c7fe0 HTTPCLIENT-2292: HttpClient ignores socketConfig#getSocksProxyAddress 2023-08-31 16:58:09 +02:00
cachescrubber 509ba6753f
Document exec chain behaviour when automatic retries are enabled. (#480) 2023-08-31 16:55:37 +02:00
Konrad Windszus f00e18d9cc HTTPCLIENT-2295 Fix links to Core Javadoc 2023-08-31 12:49:45 +02:00
Oleg Kalnichevski 8a54e70359 HTTPCLIENT-2291: fixed inconsistency in behavior between the class and async implementation of the request re-execution. The async request retry exec will now re-start request execution from itself instead of form the very beginning of the execution chain 2023-08-31 09:35:17 +02:00
Oleg Kalnichevski 9748d1baf8 Updated project wesite URL 2023-08-20 10:56:20 +02:00
Oleg Kalnichevski 9d23ddbea7 Upgraded HttpClient version to 5.3-alpha2-SNAPSHOT 2023-08-19 18:39:58 +02:00
Oleg Kalnichevski 22a257c2c2 Javadoc fix 2023-08-15 11:21:21 +02:00
Oleg Kalnichevski 09eddd9fa1 Updated release notes for HttpClient 5.3 alpha1 release 2023-08-15 10:50:08 +02:00
Oleg Kalnichevski e4eada63e4 Fixed potential NPE in DigestScheme 2023-08-13 18:08:02 +02:00
Oleg Kalnichevski 091c822edc Removed test case requiring online DNS name resolution 2023-08-12 17:14:53 +02:00
Oleg Kalnichevski 2176eb3861 GGS based experimental authentication schemes deprecated and disabled by default 2023-08-12 17:14:53 +02:00
Oleg Kalnichevski 83c6079e65 NTLM scheme deprecated and disabled by default 2023-08-12 17:14:53 +02:00
Arturo Bernal 8aa4fbc8de Improve AIMDBackoffManager Tests Stability
Enhanced test robustness for AIMDBackoffManager by introducing buffers to sleep durations in cooldown-related tests and adjusting the concurrency test. Due to persistent instability, removed the time-dependent `probeDoesNotAdjustDuringCooldownPeriod` test.
2023-08-12 17:14:53 +02:00
Arturo Bernal f203dcd34e Add AbstractBackoff, LinearBackoffManager, and ExponentialBackoffManager classes
- Create AbstractBackoff class as a base for different backoff strategies
- Add LinearBackoffManager class for implementing linear backoff algorithm in networking and communication systems. This class provides a thread-safe and configurable implementation of linear backoff, allowing for gradual adjustment of maximum connection pool sizes for a given route based on traffic and other factors. The class supports customizable cool-down periods and increment values for each route, and uses a ConcurrentHashMap to ensure thread safety and accurate tracking of backoff and probe attempts
- Implement ExponentialBackoffManager for connection pool control.
This commit introduces the ExponentialBackoffManager class, which manages the connection pool control for HTTP routes based on the Exponential Backoff algorithm. This implementation helps improve connection handling and stability in case of connection failures or network issues.
2023-08-12 17:14:53 +02:00
Arturo Bernal b565f8fab7 Improve AIMDBackoffManager with atomic references, thread-safety, and parameter checks
In this commit, we have made several improvements to the AIMDBackoffManager class:

* Replaced volatile variables with AtomicReference and AtomicInteger to ensure better thread-safety and atomic operations.
* Updated the @Contract annotation to reflect the new thread-safe behavior of the class.
 * Added parameter validation checks to public methods for better error handling and prevention of incorrect usage.
* Improved the code readability and organization by separating sections of the class with blank lines and consistent indentation.
* These enhancements make the AIMDBackoffManager class more robust, reliable, and easier to maintain.
2023-08-12 17:14:53 +02:00
Arturo Bernal 1bd7f07d17 Update NTCredentials to determine workstation name at runtime
This change modifies the NTCredentials class to determine the local workstation name at runtime or request time, in line with the underlying NTLM implementation. The deprecated constructor with the workstation parameter is replaced with a new constructor that does not require the workstation parameter. Instead, it automatically retrieves the workstation name using the getWorkstationName() method.
2023-08-12 17:14:53 +02:00
Arturo Bernal 94d73429dd Add DistributedProxySelector for efficient and thread-safe proxy selection
This commit introduces the DistributedProxySelector class, which enables efficient and thread-safe proxy selection among multiple ProxySelector instances. The new class ensures proper distribution of proxy selector usage with the help of AtomicInteger and maintains thread safety using ThreadLocal.

Key features and improvements:

Distributes proxy selection among multiple ProxySelector instances
Ensures thread safety by using ThreadLocal<ProxySelector>
Properly handles exceptions and connection failures
Comprehensive JavaDoc documentation for class, methods, and variables
Includes unit tests for various scenarios and edge cases
This new functionality provides a robust and efficient solution for distributing proxy selection in multi-threaded environments, improving the overall performance and reliability of the system.
2023-08-12 17:14:53 +02:00
Arturo Bernal 17da6d24ca Add support for preamble and epilogue in multipart entities
Previously, multipart entities did not support adding a preamble or epilogue to the message. This commit adds support for these features by modifying the AbstractMultipartFormat class to accept preamble and epilogue strings in its constructor. The HttpRFC6532Multipart, HttpRFC7578Multipart, and HttpStrictMultipart classes are updated to pass these parameters to the parent constructor when creating instances of multipart entities.

This change allows users to include custom content at the beginning and end of their multipart messages, which can be useful in certain scenarios such as adding metadata or information about the message contents.
2023-08-12 17:14:53 +02:00
Arturo Bernal 0df9e63932 Enhance ContentResponseHandler to be fault-tolerant
This commit enhances the `ContentResponseHandler` class to be more fault-tolerant by handling responses with null or empty bodies without throwing exceptions. If the response was successful (a 2xx status code), the `Content` object is returned. If no response body exists, `Content.NO_CONTENT` is returned.

The implementation extends `ContentResponseHandler` and overrides its methods to handle the response entity and transform it into the actual response object. This is designed to be efficient and use minimal memory.
2023-08-12 17:14:53 +02:00
Arturo Bernal efe57e03c6 Workaround for URL quoting issue with LLv6 host literals. Due to an issue with URL quoting for LLv6 host literals, the original implementation of SystemDefaultDnsResolver does not support constructing URLs with LLv6 literals that have a ZoneID. This commit implements a workaround that strips the ZoneID from LLv6 literals before resolving them. This allows URLs with LLv6 literals to be constructed without quoting the ZoneID. Note that this workaround does not fully comply with RFC 6874, but it should work in most cases. 2023-08-12 17:14:53 +02:00
Oleg Kalnichevski 95e8abbda8 BEARER auth scheme support (RFC 6750) 2023-08-12 17:14:53 +02:00
Oleg Kalnichevski 298506eb0e New Authenticator interface method to return an auth result with additional challenge parameters 2023-08-12 17:14:53 +02:00
Oleg Kalnichevski a4784916cc Made authenticating decorators capable of supporting different authentication schemes 2023-08-12 17:14:53 +02:00
Oleg Kalnichevski 2d77d1d579 Normalize scheme name in AuthScope 2023-08-12 17:14:53 +02:00
Oleg Kalnichevski ff35df66a5 Removed references in specific RFCs 2023-08-12 17:14:53 +02:00
Oleg Kalnichevski 55f86b9fd7 Credentials interface should be able to represent different types of user credentials including token based with no password 2023-08-12 17:14:53 +02:00
Oleg Kalnichevski c0194331c3 Upgraded project version to 5.3-alpha1-SNAPSHOT 2023-08-12 17:14:16 +02:00
Christoph Kaser 223669659c Check for timeToLive == 0
Allows setting connection timeToLive and validateAfterInactivity to zero to always close or validate a connection
2023-07-22 13:04:18 +02:00
John Vasileff d72a136817 Per RFC 7616, use the provided Response algorithm in the Request
For digest authentication, in RFC 7616 section "3.4 The Authorization
Header Field":

    The values of the opaque and algorithm fields must be those supplied
    in the WWW-Authenticate response header field for the entity being
    requested.

This commit honors that rule, and removes the previous behavior that
augmented the request header with "algorithm=MD5" when none was provided
in the server's response.

Aside from the specification, it also stands to reason that if the
server failed to provide "algorithm=..." in its "WWW-Authenticate"
header, the server should be fine with the client failing to provide
"algorithm=..." in the "Authorization" header.

The motivation for this change is that including "algorithm=MD5" in the
"Authorization" header causes http requests to fail when made to an
embedded system, which I suspect to be a an Espressif ESP32 web server.
2023-07-20 20:18:05 +02:00
Oleg Kalnichevski 9ad56ad734 Improvements in the ClientConfiguration sample app 2023-07-13 17:57:04 +02:00
Gary Gregory 09ae5f212a Mostly missing Javadoc in org.apache.hc.client5.http.entity and minor
clean ups
2023-07-02 16:31:07 -04:00