Permalink
Browse files

Set separate :ssl-port in self-signed SSL tests.

  • Loading branch information...
1 parent d0459bf commit 82a1a8bfb5027fc77655d44df5c42c58b67ea63a @technomancy technomancy committed Oct 28, 2011
Showing with 7 additions and 2 deletions.
  1. BIN test-resources/keystore
  2. +7 −2 test/clj_http/core_test.clj
View
BIN test-resources/keystore
Binary file not shown.
View
9 test/clj_http/core_test.clj
@@ -107,9 +107,14 @@
(deftest ^{:integration true} self-signed-ssl-get
(let [t (doto (Thread. #(ring/run-jetty handler
- {:port 18081 :ssl? true})) .start)]
+ {:port 8081 :ssl-port 18082 :ssl? true
+ :keystore "test-resources/keystore"
+ :key-password "keykey"})) .start)]
(try
- (let [resp (request {:request-method :get :uri "/get"
+ (is (thrown? javax.net.ssl.SSLPeerUnverifiedException
+ (request {:request-method :get :uri "/get"
+ :server-port 18082 :scheme "https"})))
+ (let [resp (request {:request-method :get :uri "/get" :server-port 18082
:scheme "https" :insecure? true})]
(is (= 200 (:status resp)))
(is (= "get" (slurp-body resp))))

0 comments on commit 82a1a8b

Please sign in to comment.