Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
- <!-- ============================================================= -->
- <!-- Configure the Jetty Server instance with an ID "Server" -->
- <!-- by adding a HTTPS connector. -->
- <!-- This configuration must be used in conjunction with jetty.xml -->
- <!-- It should not be used with jetty-spdy.xml which can provide -->
- <!-- both HTTPS and SPDY connections -->
- <!-- ============================================================= -->
- <Configure id="Server" class="org.eclipse.jetty.server.Server">
- <!-- Esto cogido de http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/jetty-server/src/main/config/etc/jetty.xml -->
- <!-- =========================================================== -->
- <!-- Http Configuration. -->
- <!-- This is a common configuration instance used by all -->
- <!-- connectors that can carry HTTP semantics (HTTP, HTTPS, SPDY)-->
- <!-- It configures the non wire protocol aspects of the HTTP -->
- <!-- semantic. -->
- <!-- -->
- <!-- This configuration is only defined here and is used by -->
- <!-- reference from the jetty-http.xml, jetty-https.xml and -->
- <!-- jetty-spdy.xml configuration files which instantiate the -->
- <!-- connectors. -->
- <!-- -->
- <!-- Consult the javadoc of o.e.j.server.HttpConfiguration -->
- <!-- for all configuration that may be set here. -->
- <!-- =========================================================== -->
- <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
- <Set name="secureScheme">https</Set>
- <Set name="securePort"><Property name="jetty.tls.port" default="8443" /></Set>
- <Set name="outputBufferSize">32768</Set>
- <Set name="requestHeaderSize">8192</Set>
- <Set name="responseHeaderSize">8192</Set>
- <!-- Uncomment to enable handling of X-Forwarded- style headers
- <Call name="addCustomizer">
- <Arg><New class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/></Arg>
- </Call>
- -->
- </New>
- <!-- =========================================================== -->
- <!-- Set the default handler structure for the Server -->
- <!-- A handler collection is used to pass received requests to -->
- <!-- both the ContextHandlerCollection, which selects the next -->
- <!-- handler by context path and virtual host, and the -->
- <!-- DefaultHandler, which handles any requests not handled by -->
- <!-- the context handlers. -->
- <!-- Other handlers may be added to the "Handlers" collection, -->
- <!-- for example the jetty-requestlog.xml file adds the -->
- <!-- RequestLogHandler after the default handler -->
- <!-- =========================================================== -->
- <Set name="handler">
- <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
- <Set name="handlers">
- <Array type="org.eclipse.jetty.server.Handler">
- <Item>
- <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
- </Item>
- <Item>
- <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
- </Item>
- </Array>
- </Set>
- </New>
- </Set>
- <!-- Fin jetty.xml -->
- <!-- Comienza jetty-https.xml -->
- <!-- =========================================================== -->
- <!-- Setup the SSL Context factory used to establish all TLS -->
- <!-- Connections and session. -->
- <!-- -->
- <!-- Consult the javadoc of o.e.j.util.ssl.SslContextFactory -->
- <!-- o.e.j.server.HttpConnectionFactory for all configuration -->
- <!-- that may be set here. -->
- <!-- =========================================================== -->
- <!--
- <New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
- <Set name="KeyStorePath"><Property name="jetty.home" default="." />/etc/keystore</Set>
- <Set name="KeyStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
- <Set name="KeyManagerPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
- <Set name="TrustStorePath"><Property name="jetty.home" default="." />/etc/keystore</Set>
- <Set name="TrustStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
- </New>
- -->
- <!-- TODO: Mejorar paths y ofuscar contraseñas
- http://docs.codehaus.org/display/JETTY/Securing+Passwords
- -->
- <New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
- <Set name="KeyStorePath"><Property name="jetty.home" default="." />/target/jetty-ssl.keystore</Set>
- <Set name="KeyStorePassword">******</Set>
- <Set name="KeyManagerPassword">******</Set>
- <Set name="TrustStorePath"><Property name="jetty.home" default="." />/src/main/resources/entidades.truststore</Set>
- <Set name="TrustStorePassword">*******</Set>
- <!--<Set name="wantClientAuth">true</Set>-->
- <!-- <Set name="needClientAuth">true</Set> -->
- <Set name="protocol">TLSv1</Set>
- </New>
- <!-- =========================================================== -->
- <!-- Create a TLS specific HttpConfiguration based on the -->
- <!-- common HttpConfiguration defined in jetty.xml -->
- <!-- Add a SecureRequestCustomizer to extract certificate and -->
- <!-- session information -->
- <!-- =========================================================== -->
- <New id="tlsHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
- <Arg><Ref id="httpConfig"/></Arg>
- <Call name="addCustomizer">
- <Arg><New class="org.eclipse.jetty.server.SecureRequestCustomizer"/></Arg>
- </Call>
- </New>
- <!-- =========================================================== -->
- <!-- Add a HTTPS Connector. -->
- <!-- Configure an o.e.j.server.ServerConnector with connection -->
- <!-- factories for TLS (aka SSL) and HTTP to provide HTTPS. -->
- <!-- All accepted TLS connections are wired to a HTTP connection.-->
- <!-- -->
- <!-- Consult the javadoc of o.e.j.server.ServerConnector, -->
- <!-- o.e.j.server.SslConnectionFactory and -->
- <!-- o.e.j.server.HttpConnectionFactory for all configuration -->
- <!-- that may be set here. -->
- <!-- =========================================================== -->
- <Call id="sslConnector" name="addConnector">
- <Arg>
- <New class="org.eclipse.jetty.server.ServerConnector">
- <Arg name="server"><Ref id="Server" /></Arg>
- <Arg name="factories">
- <Array type="org.eclipse.jetty.server.ConnectionFactory">
- <Item>
- <New class="org.eclipse.jetty.server.SslConnectionFactory">
- <Arg name="next">http/1.1</Arg>
- <Arg name="sslContextFactory"><Ref id="sslContextFactory"/></Arg>
- </New>
- </Item>
- <Item>
- <New class="org.eclipse.jetty.server.HttpConnectionFactory">
- <Arg name="config"><Ref id="tlsHttpConfig"/></Arg>
- </New>
- </Item>
- </Array>
- </Arg>
- <Set name="host"><Property name="jetty.host" /></Set>
- <Set name="port"><Property name="jetty.tls.port" default="8443" /></Set>
- <Set name="idleTimeout">30000</Set>
- </New>
- </Arg>
- </Call>
- </Configure>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement