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

Add protocol option to ssl-context #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/clj/http/async/client/cert.clj
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
:certificate-alias - A name by which to access an X509 certificate that will
be loaded into the KeyStore.

:protocol - The version of TLS to be used, by default \"TLS\", but \"TLSv1.1\"
or \"TLSv1.2\" are also supported

:trust-managers - [optional] A seq of javax.net.ssl.X509TrustManager objects.
These are used to verify the certificates sent by the remote host. If
you don't specify this option, the connection will use an instance of
Expand All @@ -135,7 +138,9 @@
keystore-password
certificate-alias
certificate-file
trust-managers]}]
trust-managers
protocol]
:or {protocol "TLS"}}]
(let [initial-keystore (load-keystore
(when keystore-file (resource-stream keystore-file))
keystore-password)
Expand All @@ -144,7 +149,7 @@
certificate-alias
(load-x509-cert certificate-file))
key-mgr-factory (key-manager-factory keystore-with-cert keystore-password)
ctx (SSLContext/getInstance "TLS")
ctx (SSLContext/getInstance protocol)
key-managers (.getKeyManagers key-mgr-factory)
trust-managers (into-array javax.net.ssl.X509TrustManager
(or trust-managers
Expand Down