TooTallNate / Java-WebSocket

A barebones WebSocket client and server implementation written in 100% Java.
http://tootallnate.github.io/Java-WebSocket
MIT License
10.53k stars 2.58k forks source link

Secure connection issue #432

Closed GeminiLoal closed 7 years ago

GeminiLoal commented 7 years ago

Hi, I tried to create a secure connection between a server and client with a self signed certificate using the examples here in the repository. I created the .jks file and I use the same file both for the server and the client but when the client tries to connect the server says:

Received fatal alert: certificate_unknown

How is it possible?

marci4 commented 7 years ago

Hello @GeminiLoal,

have you tried to build the jar directly from the sources?

For me the example provided is currently working without any problems.

Greetings marci4

GeminiLoal commented 7 years ago

Hi @marci4 , thanks for your reply.

I cloned the project then I run mvn package. In the project I used the resulting .jar marked as Java-WebSocket-1.3.1-SNAPSHOT Is this correct?

I will run some other tests an see if I can fix the issue

Greetins

marci4 commented 7 years ago

Hey @GeminiLoal,

I haven't changed any version-strings yet so I can't really tell if you have the right version.

If you still have the problem I will just send you my jar.

Greetings marci4

GeminiLoal commented 7 years ago

That would be perfect @marci4, you can send it at my mail gemini.loal at gmail.com Thanks

Greetings L

GeminiLoal commented 7 years ago

Hi @marci4 , your .jar seems a bit more stable compared to the one I used. Anyway, on the client side now I see:

write(156): {GET / HTTP/1.1 Connection: Upgrade Host: xxxxx Sec-WebSocket-Key: xxxxx Sec-WebSocket-Version: 8 Upgrade: websocket

}

On the server side I see: !isHandShakeComplete

Still no connection :(

Thanks for the help so far Greetings L

marci4 commented 7 years ago

hey @GeminiLoal,

it looks like you are using the wrong example.

You should use the example SSLClientExample and not ExampleClient

Greetings marci4

GeminiLoal commented 7 years ago

Got my error... A very stupid one, not related to this specific project.

Basically I wrote the loading of the .jsk in a wrong way...

Thank for everything, the .jar you sent me work really well! Greetings L

marci4 commented 7 years ago

Issue solved :) closing

Greetings