Java SSLEngine example

岁酱吖の 提交于 2019-12-06 01:33:05

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. :)

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.

A similar but more complete example for SSLEngine implementation can be found here.

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.

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.

later, Dean

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!