Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose TLS protocol version setting when creating SSLContext? #66

Open
claj opened this issue Feb 6, 2024 · 2 comments
Open

Expose TLS protocol version setting when creating SSLContext? #66

claj opened this issue Feb 6, 2024 · 2 comments

Comments

@claj
Copy link

claj commented Feb 6, 2024

When comparing a reference implementation of an API integration in Java for porting it to Clojure and using hato, there are some settings that cannot be set through the ->SSLContext function, namely the TLS version (defaults to "TLS" in hato, I would like to be able to set it to "TLSv1.2" in this particular case).

Would it be welcome to add an optional key named :protocol in the hato.client/->SSLContext function - and specify that is optional key means the version of the TLS-protocol the documentation, defaults to "TLS"?

@gnarroway
Copy link
Owner

Hi, thanks for your interest. I don't mind a PR for this. Please include a test and readme.

For completeness just noting some options:

  • You can also adjust it via java opts (jdk.tls.client.protocols and related) though that has broader impact.
  • You can also pass in a manually constructed SslContext, but that is less convenient.
  • Trying to set the protocol in the SslContext (via getInstance) seems to also have nuances (e.g. setting it to "TLSv1.2" will not prevent other TLS versions). But if passing in a manually constructed SslContext with the protocol set makes it work for you, then supporting this option should be fine.

@claj
Copy link
Author

claj commented Feb 26, 2024

I'm still on this, but has been busy with other things. There will be a at least two weeks more until I'm done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants