Author: markt Date: Wed Nov 2 11:13:21 2016 New Revision: 1767636 URL: http://svn.apache.org/viewvc?rev=1767636&view=rev Log: Get OpenSSL tests working on Gump again
Modified: tomcat/trunk/test/org/apache/tomcat/util/net/openssl/ciphers/TesterOpenSSL.java Modified: tomcat/trunk/test/org/apache/tomcat/util/net/openssl/ciphers/TesterOpenSSL.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/openssl/ciphers/TesterOpenSSL.java?rev=1767636&r1=1767635&r2=1767636&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/tomcat/util/net/openssl/ciphers/TesterOpenSSL.java (original) +++ tomcat/trunk/test/org/apache/tomcat/util/net/openssl/ciphers/TesterOpenSSL.java Wed Nov 2 11:13:21 2016 @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import org.apache.catalina.util.IOTools; @@ -376,8 +377,14 @@ public class TesterOpenSSL { private static String executeOpenSSLCommand(String... args) throws IOException { String openSSLPath = System.getProperty("tomcat.test.openssl.path"); + String openSSLLibPath = null; if (openSSLPath == null || openSSLPath.length() == 0) { openSSLPath = "openssl"; + } else { + // Explicit OpenSSL path may also need explicit lib path + // (e.g. Gump needs this) + openSSLLibPath = openSSLPath.substring(0, openSSLPath.lastIndexOf('/')); + openSSLLibPath = openSSLLibPath + "/../lib"; } List<String> cmd = new ArrayList<>(); cmd.add(openSSLPath); @@ -386,6 +393,18 @@ public class TesterOpenSSL { } ProcessBuilder pb = new ProcessBuilder(cmd.toArray(new String[cmd.size()])); + + if (openSSLLibPath != null) { + Map<String,String> env = pb.environment(); + String libraryPath = env.get("LD_LIBRARY_PATH"); + if (libraryPath == null) { + libraryPath = openSSLLibPath; + } else { + libraryPath = libraryPath + ":" + openSSLLibPath; + } + env.put("LD_LIBRARY_PATH", libraryPath); + } + Process p = pb.start(); InputStreamToText stdout = new InputStreamToText(p.getInputStream()); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org