 (ns puppetlabs.puppetserver.ruby.http-client-test
-  (:import (org.jruby.embed EvalFailedException LocalContextScope LocalVariableBehavior)
+  (:import (org.jruby.embed EvalFailedException)
            (org.apache.http ConnectionClosedException)
            (javax.net.ssl SSLHandshakeException)
            (java.util HashMap)
-           (java.io IOException)
-           (com.puppetlabs.jruby_utils.jruby ScriptingContainer))
+           (java.io IOException))
   (:require [clojure.test :refer :all]
             [puppetlabs.trapperkeeper.testutils.logging :as logutils]
             [puppetlabs.trapperkeeper.testutils.webserver :as jetty9]

                  10080
                  {:ssl-protocols ["SSLv3" "TLSv1"]
                   :use-ssl true})]
          (.runScriptlet sc "response = c.get('/', {})")
          (is (= "200" (.runScriptlet sc "response.code")))
          (is (= "hi" (.runScriptlet sc "response.body")))
          (terminate-scripting-container sc))))))

(deftest https-cipher-suites

      (let [sc (create-scripting-container 10080)]
        (logutils/with-test-logging
          (try
            (.runScriptlet sc (raise-caught-http-error "$c.get('/', {})"))
            (is false "Expected HTTP connection to HTTPS port to fail")
           (catch EvalFailedException e
             (is (instance? ConnectionClosedException (.getCause e))))))
