ring-clojure / ring

Clojure HTTP server abstraction
MIT License
3.75k stars 519 forks source link

Replace deprecated SslContextFactory with SslContextFactory$Server #380

Closed SuperStevenZ closed 4 years ago

SuperStevenZ commented 4 years ago

Fixes #379

Direct usage of SslContextFactory and its methods (e.g. setNeedClientAuth) has been [deprecated](https://www.eclipse.org/jetty/javadoc/9.4.19.v20190610/org/eclipse/jetty/util/ssl/SslContextFactory.html#%3Cinit%3E()) in Java class, which seems to cause Jetty adaptor to not able to accept client certs as a HTTPS server. Updating it to SslContextFactory$Server can fix this issue and follows the suggestion by Java.

This commit also adds two tests around client certs to ensure it will behave as expected.

weavejester commented 4 years ago

Thanks! This looks fine. Can you squash your commits down?

SuperStevenZ commented 4 years ago

Absolutely! Thanks for the reviews, they did make my tests look better.

weavejester commented 4 years ago

Thanks! Can you change the commit message to:

Replace deprecated SslContextFactory

Fixes #379.

I don't think any more explanation in the commit is necessary.

SuperStevenZ commented 4 years ago

That makes sense, will do.