jira-importer opened a new issue, #1251:
URL: https://github.com/apache/httpcomponents-core/issues/1251

   **[Rob 
Spoor](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=spoor)** 
opened 
**[HTTPCORE-728](https://issues.apache.org/jira/browse/HTTPCORE-728?redirect=false)**
 and commented
   
   We have a Renovate bot that upgraded the HttpClient version from 5.1.3 to 
5.2. Tests that were working before now started failing with the following 
message:
   
   ```
   Exception in thread "I/O server dispatch-1" java.lang.NoSuchMethodError: 
javax.net.ssl.SSLEngine.getApplicationProtocol()Ljava/lang/String;
        at 
org.apache.hc.core5.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:429)
   ```
   
   I've done a comparison between version 5.1.3 and 5.2, and this change is 
causing the issue:
   
   5.1.3:
   
   ```
   final String applicationProtocol = 
ReflectionUtils.callGetter(this.sslEngine, "ApplicationProtocol", String.class);
   ```
   
   5.2:
   
   ```
   final String applicationProtocol = this.sslEngine.getApplicationProtocol();
   ```
   
   The cause of the issue is that this method is officially added in Java 9. 
From 
https://docs.oracle.com/en/java/javase/19/docs/api/java.base/javax/net/ssl/SSLEngine.html#getApplicationProtocol():
   
   > Since:
   > 9
   > It seems that this method is backported to Java 8, but not to **all** 
versions. From 
https://docs.oracle.com/javase/8/docs/api/javax/net/ssl/SSLEngine.html#getApplicationProtocol--:
   
   > API Note:
   > This method is defined in Java SE 8 Maintenance Release 3.
   > One solution could be to make users upgrade Java 8 to the latest version 
(our build server currently uses version 1.8.0_221). However, that may not work 
for everybody.
   
   
   
   ---
   
   **Affects:** 5.2
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to