Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added support for nil password when none specified #206

Merged
merged 1 commit into from
May 27, 2014
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/clj_http/conn_mgr.clj
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
(let [keystore (KeyStore/getInstance (or keystore-type
(KeyStore/getDefaultType)))]
(with-open [is (io/input-stream keystore-file)]
(.load keystore is (.toCharArray keystore-pass))
(.load keystore is (when keystore-pass (.toCharArray keystore-pass)))
keystore))))

(defn ^SchemeRegistry get-keystore-scheme-registry
Expand Down
4 changes: 4 additions & 0 deletions test/clj_http/test/conn_mgr.clj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
(is (instance? KeyStore ks))
(is (> (.size ks) 0))))

(deftest load-keystore-with-nil-pass
(let [ks (conn-mgr/get-keystore "test-resources/keystore" nil nil)]
(is (instance? KeyStore ks))))

(deftest keystore-scheme-factory
(let [sr (conn-mgr/get-keystore-scheme-registry
{:keystore client-ks :keystore-pass client-ks-pass
Expand Down