Kong / unirest-java

Unirest in Java: Simplified, lightweight HTTP client library.
http://kong.github.io/unirest-java/
MIT License
2.59k stars 593 forks source link

Support for custom ciphers and protocols for https requests #381

Closed Hakky54 closed 3 years ago

Hakky54 commented 3 years ago

This pull request is an implementation for the following feature request: https://github.com/Kong/unirest-java/issues/380

Usage would be for example:

Unirest.config()
    .sslContext(sslContext)
    .protocols("TLSv1.2")
    .ciphers("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384");

This will force your client to communicate over TLSv1.2 and TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 with the server or else it will fail. This setup will also prevent your client to communicate with older protocols such as TLSv1.1 and TLSv1

Hakky54 commented 3 years ago

Thank you very much!

ryber commented 3 years ago

@Hakky54 there was an issue with the GitHub Actions setup for PRs would you mind rebasing your branch with master (or merge master, either way)

Hakky54 commented 3 years ago

I just merged your master branch with mine master branch and pushed the changes. Please let me know if something else needs to be done

ryber commented 3 years ago

This is in 3.11.04