beryx / badass-runtime-plugin

Create a custom runtime image of your non-modular application
https://badass-runtime-plugin.beryx.org
Apache License 2.0
162 stars 21 forks source link

[🐛BUG] handshake_failure with custom jre #126

Closed ErrorxCode closed 1 year ago

ErrorxCode commented 2 years ago

Problem

Since java 11, HttpClient has been introduced. It is an implementation of HTTP URL connection as a client with standard java API. However, this API requires an extra module i.e jdk.crypto.ec in the JRE. Without that, it can not talk to a server that has an elliptic curve certificate. You will get a handshake_failure error when trying to talk to a server running with this.

Solution

Just add jdk.crypto.ec in default module list for creating custom runtime.

Reference

hakanai commented 1 year ago

Is this an issue? It sounds like you fixed it in your project. If everything's good on your end, could you close the ticket?

Adding modules to the list of defaults assumes that everyone will want those defaults, but my calculator which has no need to connect to the internet certainly doesn't need to depend on crypto code.

ErrorxCode commented 1 year ago

So isn't it ? any one whose code connect to internet and get same error, shouldn't the solution be on the repo ? I just did it so that one can directly fix it without wasting time on searching stack overflow, because I also searched here in issues before going anywhere else.

Just for other's good, I am not getting money for creating such tickets.

hakanai commented 1 year ago

Yeah, you're right that the solution should be somewhere. I guess now it's in the issues anyway, so people can find it. But it would possibly be a good idea to create a FAQ at some point. Could potentially use the Wiki, I suppose.

ErrorxCode commented 1 year ago

The point of creating the issue was to somehow impliment the solution in the code itself so it's not needed to be done manually. Anyways.....

hakanai commented 1 year ago

I guess it could be rephrased that way.

Currently, the ticket has a gigantic bug emoji in the description line, along with the word "BUG" in capital letters, which makes it 100% clear that the reporter thinks it's a bug, and not a request for some new behaviour.

But anyway, I wonder how it would work in practice. In this case, pulling in HttpClient pulls in some other dependency transitively. Does the Java module system have a solution to this? It really seems to me, that if I ask for one module, and it depends on another module, that it should pull in that other module automatically. Obviously, that isn't happening here.

There's a suggestModules task which the docs say can be used to guess the modules you're likely to need, but they're very clear that the recommendation is to set the modules explicitly.

ErrorxCode commented 1 year ago

On this topic, we need to have a cold discussion. Can we talk in personal? I mean somewhere else like on Instagram 👀