clj-commons / aleph

Asynchronous streaming communication for Clojure - web server, web client, and raw TCP/UDP
http://aleph.io
MIT License
2.54k stars 241 forks source link

Improved API for SSL context management (server and client) #612

Closed DerGuteMoritz closed 2 years ago

DerGuteMoritz commented 2 years ago

This is a cherry-pick of dac2852c73c8ceeecaa15549c9de08dbcd530efd from the 1.0.0 adjusted to latest master and with some additions and corrections to docstrings.

As per https://github.com/clj-commons/aleph/pull/608#issuecomment-1200103587

DerGuteMoritz commented 2 years ago

Regarding TLS, an improvement would be to support javax.net.ssl SSLContext out of the box.

@arnaudgeiser Seems like this should be doable via https://netty.io/4.1/api/io/netty/handler/ssl/JdkSslContext.html which one could then pass as :ssl-context. Some builtin support for this in Aleph would be more convenient, of course. Should be easy to do now by adding it to coerce-ssl-context. Ideally with a test case, of course... I suggest we make this a separate issue?

arnaudgeiser commented 2 years ago

I suggest we make this a separate issue?

Yes, obviously. Just surprised it wasn't supported already.

DerGuteMoritz commented 2 years ago

@KingMob FYI: I'll resolve the conflicts (and squash where appropriate) once you've approved my latest changes!

arnaudgeiser commented 2 years ago

I tried to rebase this PR on master but unfortunately I don't have the rights to perform commits on your branch @DerGuteMoritz. Can I ask you to do so then I will merge?

DerGuteMoritz commented 2 years ago

@arnaudgeiser There you go! Only squashed the indentation commit after all.

DerGuteMoritz commented 2 years ago

Hold on a moment, I accidentlly clobbered Oleksii's original commit authorship, restoring ...

DerGuteMoritz commented 2 years ago

Alright, good to go now from my end!