Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Clojure SSL指定要用作客户端证书的本地证书_Ssl_Clojure - Fatal编程技术网

Clojure SSL指定要用作客户端证书的本地证书

Clojure SSL指定要用作客户端证书的本地证书,ssl,clojure,Ssl,Clojure,这来自python“请求”http库的python文档 “您还可以指定一个本地证书用作客户端证书、单个文件(包含私钥和证书)或两个文件路径的元组:” >>请求。获取('https://kennethreitz.com,cert=('/path/server.crt','/path/key')) 在Clojure做同样事情的好方法是什么?我查看了CLJHTTP和http工具包,但没有看到示例,您看到了吗 它有特定的证书处理测试。最重要的是名称空间 根据该测试,加载密钥库和证书的典型示例如下:

这来自python“请求”http库的python文档

“您还可以指定一个本地证书用作客户端证书、单个文件(包含私钥和证书)或两个文件路径的元组:”

>>请求。获取('https://kennethreitz.com,cert=('/path/server.crt','/path/key'))

在Clojure做同样事情的好方法是什么?我查看了CLJHTTP和http工具包,但没有看到示例,您看到了吗

它有特定的证书处理测试。最重要的是名称空间

根据该测试,加载密钥库和证书的典型示例如下:

(def ks-file "test-resources/keystore.jks")
(def cert-file "test-resources/certificate.crt")
(def password "secret")

(defn load-test-certificate [] (load-x509-cert cert-file))
(defn load-test-keystore [] (load-keystore (resource-stream ks-file) password))
(def ks-file "test-resources/keystore.jks")
(def cert-file "test-resources/certificate.crt")
(def password "secret")

(defn load-test-certificate [] (load-x509-cert cert-file))
(defn load-test-keystore [] (load-keystore (resource-stream ks-file) password))