I found an example how to implement Java SSLEngine here. Unfortunately the source code of the server is not complete. Do you know where I can find the complete source code from the tutorial?
5 Answers
Searching for an SSLEngine implementation myself, I started writing my own one, which I shared on Github. It involves an SSL/TLS server and client, and also a Demo class containing a running example. I would be glad if you take a look and even more if you provide feedback about possible bugs or better implementation.
Also feel free to check a post I uploaded on my (really newly created!) blog, where I collected various information about SSL/TLS. :)

- 888
- 9
- 14
-
Looks very good. Maybe you could add a license file so we can more happily use the code. Generally it seems to me a good example, although I am not an expert (which is why I need the example). Minor improvements could be to make the example more asynch as well as accept more than just strings. I might be able to extend it towards that as well.. – kg_sYy Sep 06 '15 at 20:48
-
Just added an MIT license, so you can freely use the code. The example definitely can be improved and I would like to work it more myself, as soon as I have the time. Feel free to contribute if you want. :) – Alex Karnezis Sep 07 '15 at 18:39
There are actually Oracle provided samples for a few of the JSSE classes which can be found here. Specifically their "simple" demo for the SSLEngine can be found here.

- 2,149
- 17
- 28
I came across the same problem some years ago and ended up writing my own library. There are some examples out there and of course there is also the code inside projects like Netty, etc. But neither option is robust or easily reusable.
TLS Channel wraps an SSLEngine in a ByteBuffer and allows to use it just like normal SocketChannels.

- 461
- 5
- 10
webpieces uses a jar ( https://mvnrepository.com/artifact/org.webpieces/core-ssl ) that wraps the SSLEngine and makes using it in any context much easier.
Of course the project/subproject is here https://github.com/deanhiller/webpieces/tree/master/core/core-ssl
Or you can just start up the whole webpieces server. (It's called webpieces because every part is a piece including that ssl piece, an async http1.1 parser, http2 parser, etc....all pieces you can steal and use). It just happens all pieces are also used to create a webserver.

- 9,477
- 4
- 61
- 77

- 19,235
- 25
- 129
- 212