8373676: Test javax/net/ssl/HttpsURLConnection/SubjectAltNameIP.java fails on a machine without IPV6
We have a Linux machine with IPV6 disabled. There the test javax/net/ssl/HttpsURLConnection/SubjectAltNameIP.java fails. Error is
java.lang.RuntimeException: Server failed to start.
at SubjectAltNameIP.doClientSide(SubjectAltNameIP.java:139)
at SubjectAltNameIP.<init>(SubjectAltNameIP.java:189)
at SubjectAltNameIP.main(SubjectAltNameIP.java:176)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
at java.base/java.lang.Thread.run(Thread.java:1516)
Caused by: java.net.SocketException: Protocol family unavailable
After looking into the test, it turned out the IPV6 address ::1 was passed in the notion [::1] to the isIPv6LiteralAddress, but this method must get the address without '[' and ']' .
Additionally I adjusted the exception a bit so that it directly mentions IPV6 and not just some 'protol family' .
Progress
- [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
Issue
- JDK-8373676: Test javax/net/ssl/HttpsURLConnection/SubjectAltNameIP.java fails on a machine without IPV6 (Bug - P4)
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28825/head:pull/28825
$ git checkout pull/28825
Update a local copy of the PR:
$ git checkout pull/28825
$ git pull https://git.openjdk.org/jdk.git pull/28825/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28825
View PR using the GUI difftool:
$ git pr show -t 28825
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28825.diff
Using Webrev
:wave: Welcome back mbaesken! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.
@MBaesken This change now passes all automated pre-integration checks.
ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.
After integration, the commit message for the final commit will be:
8373676: Test javax/net/ssl/HttpsURLConnection/SubjectAltNameIP.java fails on a machine without IPV6
Reviewed-by: jpai, dfuchs
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.
At the time when this comment was updated there had been 29 new commits pushed to the master branch:
- 87d881fee01c42f5847031a63d50873b3d438f7a: 8368493: Disable most test JSSE debug output by default, and increase the test default maximum output log size
- 30be94086aad42b99a15a05fe5115f552e8efb8b: 8373625: CPUTimeCounters creates a total counter for unsupported GCs
- 2241218ef64ed6cb51f962f3ab6db1a766f1744f: 8373631: Improve classes in the "jdk.jpackage.internal.util.function" package
- ... and 26 more: https://git.openjdk.org/jdk/compare/f5187ebf7a4d4241f01612b62c514a1e4e272658...master
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.
@MBaesken The following labels will be automatically applied to this pull request:
-
net -
security
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.
I removed the net_util_md.c exception message changes.
It's a bit odd that this
sun.net.util.IPAddressUtil.isIPv6LiteralAddress("[::1]")returns false where asInetAddress.ofLiteral("[::1]")returns a validInetAddress. ButIPAddressUtilis an internal implementation util, so that's what the expectation maybe of that implementation. The change to this test looks OK to me.
FWIW InetAddress.ofLiteral accepts the enclosing "[]" because that's what InetAddress.getByName does.
And as you noted sun.net.util.IPAddressUtil.isIPv6LiteralAddress is an internal API - it parses the literal according to the IPv6 literal syntax (which doesn't include the "[]")
jshell> InetAddress.getByName("[::1]")
$1 ==> /0:0:0:0:0:0:0:1
Thanks for the reviews ! Maybe someone wants to look also at https://bugs.openjdk.org/browse/JDK-8373704 / https://github.com/openjdk/jdk/pull/28851 ?
/integrate
Going to push as commit 9e2008bf5e9a63b640eefc6cc7ec5c4f344c4266.
Since your change was applied there have been 34 commits pushed to the master branch:
- 386ad61458a3901622b92ca56982d728c11b846a: 8373409: java/net/httpclient/http3/H3ErrorHandlingTest.java failed due to deadlock
- 94c51ce314eea7a4f188fa0db1bae0e3f3dbd230: 8372635: Lambdas do not copy over SYNTHETIC flag for local variables
- e9b4696acc966d96d42880e840c8fe27434e4e1b: 8373097: Save command should create missing parent directories
- ... and 31 more: https://git.openjdk.org/jdk/compare/f5187ebf7a4d4241f01612b62c514a1e4e272658...master
Your commit was automatically rebased without conflicts.
@MBaesken Pushed as commit 9e2008bf5e9a63b640eefc6cc7ec5c4f344c4266.
:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.