-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -501,16 +501,16 @@ | |
(nil? (.getProtocols params))))) | ||
(let [params (http/->SSLParameters {:ciphers ["SSL_NULL_WITH_NULL_NULL"]})] | ||
(is (and (instance? javax.net.ssl.SSLParameters params) | ||
(= (first (.getCipherSuites params)) "SSL_NULL_WITH_NULL_NULL")))) | ||
(= "SSL_NULL_WITH_NULL_NULL" (first (.getCipherSuites params)))))) | ||
(let [params (http/->SSLParameters {:protocols ["TLSv1"]})] | ||
(is (and (instance? javax.net.ssl.SSLParameters params) | ||
(= (first (.getProtocols params)) "TLSv1")))) | ||
(= "TLSv1" (first (.getProtocols params)))))) | ||
(let [params-from-opts (http/->SSLParameters {:ciphers ["SSL_NULL_WITH_NULL_NULL"] | ||
:protocols ["TLSv1"]}) | ||
params-from-params (http/->SSLParameters params-from-opts)] | ||
(is (and (instance? javax.net.ssl.SSLParameters params-from-params) | ||
(= (first (.getCipherSuites params-from-params)) "SSL_NULL_WITH_NULL_NULL") | ||
(= (first (.getProtocols params-from-params)) "TLSv1"))))) | ||
(= "SSL_NULL_WITH_NULL_NULL" (first (.getCipherSuites params-from-params))) | ||
(= "TLSv1" (first (.getProtocols params-from-params))))))) | ||
|
||
(deftest executor-test | ||
(testing "nil passthrough" | ||
|
@@ -534,6 +534,14 @@ | |
(str (#'i/uri-with-query (java.net.URI. "https://borkdude:[email protected]:80/?q=1#/dude") | ||
"q=%26moo")))))) | ||
|
||
(deftest ring-client-test | ||
(let [resp (http/get "https://clojure.org" | ||
{:client (fn [req] | ||
{:body (java.io.ByteArrayInputStream. (.getBytes "Hello")) | ||
:clojure (= "https://clojure.org" (str (:uri req)))})})] | ||
(is (:clojure resp)) | ||
(is (= "Hello" (:body resp))))) | ||
|
||
(comment | ||
(run-server) | ||
(stop-server)) |