             (.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))))))))))
+              (is (instance? ProtocolException (.getCause e))))))))))
 
   (testing "Can connect via TLSv1 by default"
     (with-webserver-with-protocols ["TLSv1"] nil

  (or
    (instance? ConnectionClosedException ex)
    (instance? SSLHandshakeException ex)
    (and (instance? IOException ex)
         (= "Connection reset by peer" (.getMessage ex)))))


(ns puppetlabs.puppetserver.ruby.http-client-test
  (:import (org.jruby.embed EvalFailedException)
           (org.apache.http ProtocolException ConnectionClosedException)
           (javax.net.ssl SSLHandshakeException SSLException)
           (java.util HashMap)
           (java.io IOException)
           (java.util.zip GZIPInputStream))
