http.async.client.cert documentation

Asynchronous HTTP Client - Clojure - Utils


Positional factory function for class http.async.client.cert.BlindTrustManager.


(add-x509-cert keystore cert-alias certificate)
Adds the x509 certificate to the specified keystore. Param cert-alias
is a name for this cert. Returns KeyStore with the certificate loaded.


(key-manager-factory keystore password)
Returns a key manager for X509 certs using the speficied keystore.


(load-embedded-resource resource)
Loads a resource embedded in a jar file. Returns an InputStream


(load-keystore keystore-stream password)
Loads a KeyStore from the specified file. Param keystore-stream is
an InputStream.  If password is provided, that will be used to unlock
the KeyStore. Password may be nil. If keystore-stream is nil, this
returns an empty default KeyStore.


(load-x509-cert path)
Loads an x509 certificate from the specified path, which may be either
a file system path or a path to an embedded resource in a jar file.
Returns an instace of


(map->BlindTrustManager m__5665__auto__)
Factory function for class http.async.client.cert.BlindTrustManager, taking a map of keywords to field values.


(resource-stream path)
Loads the resource at the specified path, and returns it as an
InputStream. If there is no file at the specified path, and we
are running as a jar, we'll attempt to load the resource embedded
within the jar at the specified path.


(ssl-context & {:keys [keystore-file keystore-password certificate-alias certificate-file trust-managers]})
Creates a new SSLContext with x509 certificates. This allows you to use client
certificates in your async http requests.

File params should be relative to resources when your app is running as a jar.
For example, if your certificate file is in resources/security/mycert.pem,
then the :certificate-file param would be "security/mycert.pem".

:keystore-file - Path to Java keystore containing any private keys and
trusted certificate authority certificates required for this connection.
If this is empty, will use default keystore.

:keystore-password - Password to unlock KeyStore.

:certificate-file The path to the file containing an X509 certificate
(or certificate chain) to be used in the https connection

:certificate-alias - A name by which to access an X509 certificate that will
be loaded into the KeyStore.

:trust-managers - [optional] A seq of 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
BlindTrustManager, which blindly trusts all certificates. This is handy,
but it's not particularly safe.