private static HttpConnectionFactory createHttpConnectionFactory(boolean trustForwardHeaders) {
        HttpConfiguration httpConfig = new HttpConfiguration();
        httpConfig.setSecureScheme("https");
        if(trustForwardHeaders)
            httpConfig.addCustomizer(new ForwardedRequestCustomizer());
        return new HttpConnectionFactory(httpConfig);
    }
Creates a ssl jetty socket jetty. Keystore required, truststore
optional. If truststore not specified keystore will be reused.

@param server    Jetty server
@param sslStores the security sslStores.
@param host      host
@param port      port
@return a ssl socket jetty
src/main/java/spark/embeddedserver/jetty/SocketConnectorFactory.java