644 Commits

Author SHA1 Message Date
Oleg Kalnichevski
3235f009d5 HTTPCLIENT-751: Support for RFC 2817 (Upgrading to TLS Within HTTP/1.1) 2024-01-29 14:15:16 +01:00
Oleg Kalnichevski
1111c62dd3 Classic ExecRuntime to support information responses (1xx) 2024-01-29 14:15:16 +01:00
Oleg Kalnichevski
7cf469c5cc Connect executors to update the execution context with the protocol and TLS details upon successful connect 2024-01-29 14:15:16 +01:00
Oleg Kalnichevski
9833c35728 Connection endpoints to provide TLS details and protocol version 2024-01-29 14:15:16 +01:00
Oleg Kalnichevski
9d225a6517 Realigned the behavior of TLS upgrade in the classic and async connection operators 2024-01-26 10:19:34 +01:00
Oleg Kalnichevski
9d75647eca Deprecated ConnectionSocketFactory, LayeredConnectionSocketFactory and their plain and SSL implementations in favor of DefaultClientTlsStrategy 2024-01-26 10:19:34 +01:00
Oleg Kalnichevski
c7fa0b1dad Standard client TLS strategy implementations to support upgrade of blocking sockets 2024-01-26 10:19:34 +01:00
Oleg Kalnichevski
851c8df9ff Move plain socket create and connect operations to HttpClientConnectionOperator 2024-01-26 10:19:34 +01:00
Andrea Cosentino
4adaa20be6 Use MessageDigest.isEquals method when comparing signatures in NTLMEngineImpl
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
2024-01-25 14:07:20 +01:00
Oleg Kalnichevski
4f8f34fe5c More consistent request interceptor naming; fixed inconsistent sequence of request interceptors in the classic and async HttpClient builders 2024-01-22 16:35:27 +01:00
Oleg Kalnichevski
a1e8e9082e Better ETag handling 2024-01-18 20:08:39 +01:00
Oleg Kalnichevski
07586902ec ETag API 2024-01-18 20:08:39 +01:00
Oleg Kalnichevski
a1fa1739bf Fixed a design mistake of ConnectionEndpoint having a direct dependency on HttpRequestExecutor class 2024-01-17 12:55:14 +01:00
Clayton Walker
a8db310f2d Allow backwards-compatible createSocket calls 2024-01-16 21:41:02 +01:00
Oleg Kalnichevski
b66ad6e4ff Example demonstrating how to make HttpClient negotiate or force a particular version of HTTP protocol during the TLS handshake 2024-01-16 10:29:55 +01:00
Oleg Kalnichevski
5f6ad302ba Corrected the use of the wrong request object in the example 2024-01-14 11:29:05 +01:00
Oleg Kalnichevski
8d9c764d6e Added example demonstrating how to get details of the underlying connection endpoint 2024-01-14 11:18:43 +01:00
Oleg Kalnichevski
b3da0ae138 Refactor ContextBuilder into a common abstract class and HttpClientContext specific builder 2024-01-12 09:23:42 +01:00
Oleg Kalnichevski
ef77109f35 HTTPCLIENT-2315: client builders fails to apply system properties to the default connection manager 2024-01-08 15:30:28 +01:00
Philip Helger
8228ddf28a HTTPCLIENT-2314: Handle gracefully a failure of DnsResolver to return a list of resolved addresses (#533) 2024-01-07 15:45:32 +01:00
Oleg Kalnichevski
e2385f7d9a HTTPCLIENT-2314: Throw ConnectionShutdownException in case of pooled connection having been closed or discarded instead of plain IllegalStateException 2024-01-05 14:29:15 +01:00
Oleg Kalnichevski
c5de6961d1 Upgraded HttpClient version to 5.4-alpha2-SNAPSHOT 2023-12-29 10:47:10 +01:00
Oleg Kalnichevski
bb27f666c2 Javadoc fix 2023-12-26 15:47:39 +01:00
Oleg Kalnichevski
4e43daf744 Regression: incorrect hash calculation (missing realm component) 2023-12-26 15:21:43 +01:00
Oleg Kalnichevski
1906539847 Use core percent codec instead of internal one 2023-12-23 13:28:51 +01:00
Oleg Kalnichevski
4dc82b40f6 Removed references to deprecated functions 2023-12-23 13:16:25 +01:00
Oleg Kalnichevski
20bd815e74 Upgraded HttpCore to version 5.3-alpha1 2023-12-23 12:24:16 +01:00
dependabot[bot]
f2ea21bea9 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-12-23 10:44:13 +01:00
Arturo Bernal
94e43b2bb4 Implement username* validation and decoding in DigestScheme (#511)
Introduces validation and decoding logic for the 'username*' field in the DigestScheme class. The changes ensure compliance with RFC 7616 and RFC 5987 by handling cases where the 'username' contains characters not allowed in an ABNF quoted-string.
2023-12-13 11:54:49 +01:00
Arturo Bernal
3eaf9bf5c0 Implement Support for Userhash Parameter in Digest Authentication as per RFC 7616 (#509)
This commit introduces support for the userhash parameter in Digest Authentication, conforming to the specifications outlined in RFC 7616. The userhash parameter enhances security by allowing the client to hash the username before transmission, thereby protecting the username during transport. This implementation ensures that when the server indicates support for username hashing (userhash=true), the client correctly calculates and includes the hashed username in the Authorization header field, adhering to the protocol defined in RFC 7616 for enhanced security in HTTP Digest Access Authentication.
2023-12-13 11:54:49 +01:00
Arturo Bernal
6976ab58f2 Enforce Support for UTF-8 Encoding Scheme in Digest Authentication as per RFC 7616 (#508)
This commit enforces the use of the 'UTF-8' encoding scheme as the sole allowed value for character encoding in Digest Authentication, in alignment with the guidelines specified in RFC 7616.
2023-12-13 11:54:49 +01:00
Arturo Bernal
7b761fb2c3 Enforce UTF-8 Encoding in BasicSchemeFactory for RFC 7617 Compliance (#506)
- Deprecated the constructor in BasicSchemeFactory that allows setting a custom Charset.
- Updated the default constructor to use StandardCharsets.UTF_8, aligning with RFC 7617 which mandates UTF-8 encoding for Basic Authentication.
2023-12-13 11:54:48 +01:00
Arturo Bernal
aa5bc56abe Implement Password Validation in BasicScheme. (#505)
Introduced a new method, `validatePassword`, in the `BasicScheme` class to enforce password validation in line with RFC 7617 standards. This method includes control character validation for passwords, ensuring they adhere to RFC 7617 by not containing any control characters.
2023-12-13 11:54:48 +01:00
Arturo Bernal
7724432894 HTTPCLIENT-2301. Refactor release method to use local conn variable. This commit updates the release method to use the local conn variable from internalEndpoint.detach() for accurate state management and resource cleanup, addressing the issue HTTPCLIENT-2301. (#502) 2023-12-13 11:54:47 +01:00
Arturo Bernal
6a5516f99e Refactor RequestIfRange class to use DateUtils for date parsing. (#497)
* Updates the RequestIfRange class to utilize DateUtils for parsing standard HTTP dates.
* Optimize time difference check in RequestIfRange with Instant API.
2023-12-13 11:54:47 +01:00
Oleg Kalnichevski
915b9b34d7 HTTPCLIENT-2293: Better name for the standard date pattern 2023-12-13 11:54:46 +01:00
Oleg Kalnichevski
4b7986370f HTTPCLIENT-2293: client protocol handlers to try to send Host as the first header in the request header section per RFC 9110 section 7.2 2023-12-13 11:54:45 +01:00
Arturo Bernal
83e0339d27 HTTPCLIENT-2293 - Implement RFC-compliant TRACE request interceptor (#486)
- Add RequestTraceInterceptor class to handle HTTP TRACE requests in compliance with RFC 7231, Section 4.3.8.
  - Throw ProtocolException for sensitive headers like 'Authorization' and 'Cookie' in TRACE requests.
  - Throw ProtocolException if TRACE request contains a body.
2023-12-13 11:54:45 +01:00
Arturo Bernal
888232447b HTTPCLIENT-2293 - Implement 'If-Range' request validation as per RFC 9110 (#485)
- Ensure the presence of 'Range' header when 'If-Range' is specified.
- Enforce strong validator requirements when 'If-Range' is paired with a Date.
- Exit processing early if 'Last-Modified' header is missing, ensuring strong validation adherence.
2023-12-13 11:54:45 +01:00
Arturo Bernal
889a6bb085 HTTPCLIENT-2293 Enforce port specification for CONNECT requests as per RFC 9110 (#482)
- This adheres to RFC 9110, which states: "There is no default port; a client MUST send the port number even if the CONNECT request is based on a URI reference that contains an authority component with an elided port.
2023-12-13 11:54:44 +01:00
Arturo Bernal
8466b19861 Refactor HttpClient synchronized sections for virtual threads (#476)
- Replaced `synchronized` blocks with `ReentrantLock` in `LeaseRequest` to better support virtual threads introduced in JDK 21.
- Ensured each `LeaseRequest` instance has its own unique lock for maintaining original synchronization semantics.
- Addressed potential performance and deadlock issues with virtual threads by using explicit lock primitives from `java.util.concurrent.locks`.
2023-12-13 11:54:44 +01:00
Oleg Kalnichevski
f7de67ff25 Upgraded project version to 5.4-alpha1 2023-12-13 11:54:30 +01:00
Oleg Kalnichevski
9e3d79bede Fixed NPE in debug log 2023-12-10 12:40:50 +01:00
Arturo Bernal
5ab7f21dcb Refactor ExponentialBackoffManager and TestLinearBackoffManager Tests to Remove Thread.sleep(). (#495)
This commit enhances the ExponentialBackoffManager and TestLinearBackoffManager unit tests by replacing the use of Thread.sleep() with direct manipulation of internal state to simulate the cooldown period. This change improves test reliability and ensures consistent behavior in resource-constrained environments.
2023-12-06 20:36:57 +01:00
Arturo Bernal
5c69779f7d Fix features BackoffManager Unit Tests in Resource-Constrained Environments. (#494)
This commit improves the reliability of BackoffManager unit tests by replacing the use of Thread.sleep() with a more robust approach that manipulates lastRouteProbes to simulate the cooldown period. This enhancement ensures that the tests run successfully even in resource-constrained environments, making them more resilient and reliable.
2023-12-06 20:36:40 +01:00
Oleg Kalnichevski
f6a37780cf Upgraded HttpClient version to 5.3.1-SNAPSHOT 2023-12-06 16:54:47 +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