         (shutdown webserver-context)
         (throw e)))
     webserver-context))
-
-(sm/defn ^:always-validate
-  add-handler :- ContextHandler
-  [webserver-context :- WebserverServiceContext
-   handler :- ContextHandler]
-  (.addHandler (:handlers webserver-context) handler)
-  handler)
 
 (sm/defn ^:always-validate
   add-context-handler :- ContextHandler

;; NOTE: this code is an adaptation of ring-jetty-handler.
;;  It adds some SSL utility functions, and
;;  provides the ability to dynamically register ring handlers.

(ns puppetlabs.trapperkeeper.services.webserver.jetty9-core
  "Adapter for the Jetty webserver."
  (:import (org.eclipse.jetty.server Handler Server Request ServerConnector
                                     HttpConfiguration HttpConnectionFactory
                                     ConnectionFactory)

      nil)
    context))

(sm/defn ^:always-validate
  get-proxy-client-context-factory :- SslContextFactory
  [ssl-config :- config/WebserverSslPemConfig]
  (-> ssl-config
      config/pem-ssl-config->keystore-ssl-config
      (ssl-context-factory :none)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Jetty Server / Connector Functions

(defn- connection-factory
  []
