Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very misleading error message if jdk.crypto.ec module is missing #234

Open
Vampire opened this issue Oct 28, 2021 · 0 comments
Open

Very misleading error message if jdk.crypto.ec module is missing #234

Vampire opened this issue Oct 28, 2021 · 0 comments

Comments

@Vampire
Copy link

Vampire commented Oct 28, 2021

If you have a runtime image without module jdk.crypto.ec but try to connect to a service that needs it like Discord, this library complains that the hostname does not match which is plainly wrong and very misleading:

$ rm -rf jre
$ ~/.gradle/jdks/jdk-17+35/bin/jlink --add-modules jdk.jshell,jdk.zipfs --output jre
$ jre/bin/jshell.exe -c nv-websocket-client-2.6.jar
|  Welcome to JShell -- Version 17
|  For an introduction type: /help intro

jshell> new com.neovisionaries.ws.client.WebSocketFactory().createSocket("wss://gateway.discord.gg").connect()
|  Exception com.neovisionaries.ws.client.HostnameUnverifiedException: The certificate of the peer does not match the expected hostname (gateway.discord.gg)
|        at SocketConnector.verifyHostname (SocketConnector.java:171)
|        at SocketConnector.doConnect (SocketConnector.java:126)
|        at SocketConnector.connect (SocketConnector.java:83)
|        at WebSocket.connect (WebSocket.java:2307)
|        at (#1:1)

jshell>
$ rm -rf jre
$ ~/.gradle/jdks/jdk-17+35/bin/jlink --add-modules jdk.jshell,jdk.zipfs,jdk.crypto.ec --output jre
$ jre/bin/jshell.exe -c nv-websocket-client-2.6.jar
|  Welcome to JShell -- Version 17
|  For an introduction type: /help intro

jshell> new com.neovisionaries.ws.client.WebSocketFactory().createSocket("wss://gateway.discord.gg").connect()
$1 ==> com.neovisionaries.ws.client.WebSocket@6f4a47c7

jshell>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant