X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=lib%2Fjetty%2Forg%2Feclipse%2Fjetty%2Fserver%2FSecureRequestCustomizer.java;fp=lib%2Fjetty%2Forg%2Feclipse%2Fjetty%2Fserver%2FSecureRequestCustomizer.java;h=b017461310eecebf5bbfc64a840df72860d6d3cf;hp=0000000000000000000000000000000000000000;hb=73ef54a38e3930a1a789cdc6b5fa23cdd4c9d086;hpb=515007c7c1351045420669d65b59c08fa46850f2
diff --git a/lib/jetty/org/eclipse/jetty/server/SecureRequestCustomizer.java b/lib/jetty/org/eclipse/jetty/server/SecureRequestCustomizer.java
new file mode 100644
index 00000000..b0174613
--- /dev/null
+++ b/lib/jetty/org/eclipse/jetty/server/SecureRequestCustomizer.java
@@ -0,0 +1,168 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.server;
+
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLSession;
+
+import org.eclipse.jetty.http.HttpScheme;
+import org.eclipse.jetty.io.ssl.SslConnection;
+import org.eclipse.jetty.io.ssl.SslConnection.DecryptedEndPoint;
+import org.eclipse.jetty.util.TypeUtil;
+import org.eclipse.jetty.util.log.Log;
+import org.eclipse.jetty.util.log.Logger;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
+
+public class SecureRequestCustomizer implements HttpConfiguration.Customizer
+{
+ private static final Logger LOG = Log.getLogger(SecureRequestCustomizer.class);
+
+ /**
+ * The name of the SSLSession attribute that will contain any cached information.
+ */
+ public static final String CACHED_INFO_ATTR = CachedInfo.class.getName();
+
+
+ @Override
+ public void customize(Connector connector, HttpConfiguration channelConfig, Request request)
+ {
+ if (request.getHttpChannel().getEndPoint() instanceof DecryptedEndPoint)
+ {
+ request.setScheme(HttpScheme.HTTPS.asString());
+ request.setSecure(true);
+ SslConnection.DecryptedEndPoint ssl_endp = (DecryptedEndPoint)request.getHttpChannel().getEndPoint();
+ SslConnection sslConnection = ssl_endp.getSslConnection();
+ SSLEngine sslEngine=sslConnection.getSSLEngine();
+ customize(sslEngine,request);
+ }
+
+ }
+
+ /* ------------------------------------------------------------ */
+ /*
+ * Allow the Listener a chance to customise the request. before the server
+ * does its stuff.
+ * This allows the required attributes to be set for SSL requests.
+ * The requirements of the Servlet specs are:
+ *