Skip to content

Conversation

Copy link

Copilot AI commented Dec 12, 2025

Description

Apache HttpClient 5.5 deprecated several core APIs used in AdyenHttpClient. This refactoring migrates to the recommended replacements while maintaining identical functionality.

Changes:

  • SSL/TLS strategy: Replaced SSLConnectionSocketFactory with DefaultClientTlsStrategy, changed connection manager from setSSLSocketFactory() to setTlsSocketStrategy()
  • Connect timeout: Moved from deprecated RequestConfig.Builder.setConnectTimeout() to ConnectionConfig.setConnectTimeout(Timeout) applied at connection manager level
  • Proxy configuration: Replaced RequestConfig.Builder.setProxy() with DefaultProxyRoutePlanner set via route planner. Now respects proxy type (HTTP/SOCKS) from Proxy object
  • Imports: Added ConnectionConfig, DefaultProxyRoutePlanner, DefaultClientTlsStrategy, Timeout; removed SSLConnectionSocketFactory

Tested scenarios

  • All existing unit tests pass (ClientTest, AdyenCustomRedirectStrategyTest, PaymentTest)
  • Compilation with -Xlint:deprecation produces zero warnings for AdyenHttpClient
  • SSL context, hostname verifier, proxy, and timeout configurations verified through existing test coverage

Fixed issue: #1601

Original prompt

This section details on the original issue you should resolve

<issue_title>Refactor integration of Apache HttpClient 5.5</issue_title>
<issue_description>### Feature summary

Refactor usage of deprecated method and adopt best practices

Problem statement

In #1596 the Apache HttpClient dependency has been upgraded to v5.5. The new version deprecate several methods, requiring a refactoring of the AdyenHttpClient class.

This shall be planned in major release

Proposed solution

Refactor the code that integrates Apache HttpClient 5.5 to adopt the best practices.

Alternatives considered

No response

Additional context

No response</issue_description>

<agent_instructions>Refactor to avoid using deprecated methods in the Apache HttpClient. </agent_instructions>

Comments on the Issue (you are @copilot in this section)

@gcatanese Hey @stijnn17, we are not planning to perform the refactoring now, but we plan the release of a new version (that works with Apache Http Client 5.5) on week 50 (from Dec 7th).

The refactoring to avoid using deprecated methods is important, but it doesn't affect the library or your integration.

@gcatanese Hey @stijnn17, we have release a patch [v40.0.1](https://github.com/Adyen/adyen-java-api-library/releases/tag/v40.0.1). See also [here](https://github.com//issues/1586#issuecomment-3607395368)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Refactor integration of Apache HttpClient 5.5 Refactor Apache HttpClient 5.5 integration to remove deprecated API usage Dec 12, 2025
Copilot AI requested a review from gcatanese December 12, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor integration of Apache HttpClient 5.5

2 participants