 (ns clj-http.core
   "Core HTTP request/response implementation."
   (:require [clojure.pprint])
-  (:import (java.io ByteArrayOutputStream File FilterInputStream InputStream)
+  (:import (java.io ByteArrayOutputStream File FilterInputStream InputStream FileInputStream)
            (java.net URI)
+           (java.security KeyStore)
            (org.apache.http HeaderIterator HttpRequest HttpEntity
                             HttpEntityEnclosingRequest
                             HttpResponse Header HttpHost)

           headers content-type character-encoding body socket-timeout
           conn-timeout multipart debug debug-body insecure? save-request?
           proxy-host proxy-port as cookie-store retry-handler] :as req}]
  (let [conn-mgr (or *connection-manager* (make-regular-conn-manager insecure?))
        http-client (DefaultHttpClient.
                      ^org.apache.http.conn.ClientConnectionManager conn-mgr)
        scheme (name scheme)]

           (org.apache.http.conn.scheme PlainSocketFactory
                                        SchemeRegistry Scheme)
           (org.apache.http.conn.ssl SSLSocketFactory TrustStrategy)
           (org.apache.http.impl.conn SingleClientConnManager SchemeRegistryFactory)
           (org.apache.http.impl.conn.tsccm ThreadSafeClientConnManager)
           (org.apache.http.impl.client DefaultHttpClient)
           (org.apache.http.util EntityUtils)))
