rybalkinsd / kohttp

Kotlin DSL http client
https://kohttp.gitbook.io
Apache License 2.0
478 stars 42 forks source link

Added support for ssl material with jdk 9 and upwards #184

Closed Hakky54 closed 4 years ago

Hakky54 commented 4 years ago

This is a fix for configuring ssl/tls when using jdk 9 and upwards. the issue is mentioned here: https://github.com/rybalkinsd/kohttp/issues/183

Summary: The underlying client throws a runtime exception when setting only the sslSocketFactory while building the custom koclient. The underlying client requires the sslSocketFactory as well as the trustManager to be present when configuring it with ssl/tls.

I am new to Kotlin so this is actually my best effort. I am not quite sure if the provided solution fits with your coding standards. I am open for feedback and I would gladly improve it if required. Please let me know if I need to change anything.

Hakky54 commented 4 years ago

@rybalkinsd I applied all your feedback. I also agree that the other ssl related properties should be group together within the SslConfig class. Could you again have a quick look at all the changes if I missed anything?

Would be awesome to have this feature within the next release!

Hakky54 commented 4 years ago

That was quite fun working in this way together with the quick feedback loop! Thanks for applying this pull request 😄

rybalkinsd commented 4 years ago

@Hakky54 Thanks for your contribution! We have lots of tasks if you're interested 😃

Hakky54 commented 4 years ago

Sure sounds fun, what kind of tasks?