diff --git a/test/jdk/javax/net/ssl/TLSCommon/interop/Utilities.java b/test/jdk/javax/net/ssl/TLSCommon/interop/Utilities.java index 34cccb5356c..0a825d6cc7d 100644 --- a/test/jdk/javax/net/ssl/TLSCommon/interop/Utilities.java +++ b/test/jdk/javax/net/ssl/TLSCommon/interop/Utilities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -430,10 +430,10 @@ public class Utilities { public static String expectedNegoAppProtocol(String[] serverAppProtocols, String[] clientAppProtocols) { if (serverAppProtocols != null && clientAppProtocols != null) { - for(String clientAppProtocol : clientAppProtocols) { - for(String serverAppProtocol : serverAppProtocols) { - if (clientAppProtocol.equals(serverAppProtocol)) { - return clientAppProtocol; + for(String serverAppProtocol : serverAppProtocols) { + for(String clientAppProtocol : clientAppProtocols) { + if (serverAppProtocol.equals(clientAppProtocol)) { + return serverAppProtocol; } } } diff --git a/test/jdk/javax/net/ssl/compatibility/AlpnTest.java b/test/jdk/javax/net/ssl/compatibility/AlpnTest.java index 71a60fe5435..86b75f4d2c3 100644 --- a/test/jdk/javax/net/ssl/compatibility/AlpnTest.java +++ b/test/jdk/javax/net/ssl/compatibility/AlpnTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,8 @@ * @run main/manual AlpnTest false */ +import jtreg.SkippedException; + import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -98,6 +100,19 @@ public class AlpnTest extends ExtInteropTest { clientCase.setCipherSuites(cipherSuite); clientCase.setAppProtocols("h2"); + testCases.add( + new TestCase(serverCase, clientCase)); + + serverCase = ExtUseCase.newInstance(); + serverCase.setCertTuple(certTuple); + serverCase.setAppProtocols("http/1.1", "h2"); + + clientCase = ExtUseCase.newInstance(); + clientCase.setCertTuple(certTuple); + clientCase.setProtocols(protocol); + clientCase.setCipherSuites(cipherSuite); + clientCase.setAppProtocols("h2", "http/1.1"); + testCases.add( new TestCase(serverCase, clientCase)); } @@ -171,6 +186,10 @@ public class AlpnTest extends ExtInteropTest { Boolean defaultJdkAsServer = Boolean.valueOf(args[0]); Set jdkInfos = Utils.jdkInfoList(); + if (jdkInfos.isEmpty()) { + throw new SkippedException("No JDKs to test"); + } + for (JdkInfo jdkInfo : jdkInfos) { AlpnTest test = new AlpnTest( defaultJdkAsServer ? JdkInfo.DEFAULT : jdkInfo,