carterkozak commented on a change in pull request #212:
URL: 
https://github.com/apache/httpcomponents-core/pull/212#discussion_r465716546



##########
File path: 
httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java
##########
@@ -233,7 +233,7 @@ public void testNegotiateProtocol() throws Exception {
         final HttpResponse response1 = message1.getHead();
         Assert.assertThat(response1.getCode(), 
CoreMatchers.equalTo(HttpStatus.SC_OK));
 
-        if (javaVersion >= 9) {
+        if (javaVersion >= 8) {

Review comment:
       Looks like the backport was 8u251, not 8u252. off by one error in my 
previous comment: 
https://www.oracle.com/java/technologies/javase/8u251-relnotes.html
   
   How about something like this?
   
   ```java
       private boolean isAlpnAvailable() {
           if (javaVersion > 8) {
               return true;
           }
           if (javaVersion == 8) {
               // ALPN was backported to java 8u251. Using a java 8 runtime 
this can be detected
               // based on the presence of the 'getApplicationProtocol' method.
               try {
                   SSLEngine.class.getMethod("getApplicationProtocol");
                   return true;
               } catch (NoSuchMethodException e) {
                   return false;
               }
           }
           return false;
       }
   ```




----------------------------------------------------------------
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.

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