diff options
author | Thomas Watson | 2014-04-30 15:56:41 +0000 |
---|---|---|
committer | Thomas Watson | 2014-04-30 15:56:41 +0000 |
commit | e96c48387b6a307fa2e1168aec695142717cb9ae (patch) | |
tree | c39b9c35fbe6a371a0f028c772031fb65cd73e4b | |
parent | d1d73573bf7006585bf5d3e88c22a1cdf2d5d1a4 (diff) | |
download | rt.equinox.bundles-e96c48387b6a307fa2e1168aec695142717cb9ae.tar.gz rt.equinox.bundles-e96c48387b6a307fa2e1168aec695142717cb9ae.tar.xz rt.equinox.bundles-e96c48387b6a307fa2e1168aec695142717cb9ae.zip |
Bug 429714 - Pre-initialize SSLSocketFactory.getDefault() in BridgeI20140512-2000I20140511-2000I20140510-1500I20140509-2000I20140508-2000I20140507-2000I20140506-2000I20140505-2000I20140504-2000I20140503-1500I20140502-2000I20140501-0200I20140430-2000
Servlet init
-rw-r--r-- | bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/BridgeServlet.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/BridgeServlet.java b/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/BridgeServlet.java index 43448e25d..025ea4a79 100644 --- a/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/BridgeServlet.java +++ b/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/BridgeServlet.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 Cognos Incorporated, IBM Corporation and others. + * Copyright (c) 2005, 2014 Cognos Incorporated, IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,6 +12,7 @@ package org.eclipse.equinox.servletbridge; import java.io.IOException; +import java.lang.reflect.Method; import java.util.StringTokenizer; import javax.servlet.ServletException; import javax.servlet.http.*; @@ -63,6 +64,19 @@ public class BridgeServlet extends HttpServlet { } } + // Forces load of the SSLSocketFactory on the web-app context class loader + String initSSLSocketFactory = getServletConfig().getInitParameter("_initSSLSocketFactory"); //$NON-NLS-1$ + if (!"false".equals(initSSLSocketFactory)) { //$NON-NLS-1$ + try { + Class clazz = this.getClass().getClassLoader().loadClass("javax.net.ssl.SSLSocketFactory"); //$NON-NLS-1$ + Method getDefaultMethod = clazz.getMethod("getDefault", null); //$NON-NLS-1$ + getDefaultMethod.invoke(null, null); + } catch (Exception e) { + // best effort -- log problems + getServletContext().log("Bridge Servlet _initSSLSocketFactory - failed - " + e.getMessage()); //$NON-NLS-1$ + } + } + String frameworkLauncherClassParameter = getServletConfig().getInitParameter("frameworkLauncherClass"); //$NON-NLS-1$ if (frameworkLauncherClassParameter != null) { try { |