Description: Uses updated test certificates to avoid a build failure when the tests are enabled.
 The updated keystores were taken from Tomcat 7.0.39 (http://svn.apache.org/r1451105)
Author: Emmanuel Bourg <ebourg@apache.org>
diff --git a/test/org/apache/tomcat/util/net/TestCustomSsl.java b/test/org/apache/tomcat/util/net/TestCustomSsl.java
index b74279c..5f59387 100644
--- a/test/org/apache/tomcat/util/net/TestCustomSsl.java
+++ b/test/org/apache/tomcat/util/net/TestCustomSsl.java
@@ -62,7 +62,7 @@ public class TestCustomSsl extends TomcatBaseTest {
         connector.setProperty("sslProtocol", "tls");
 
         File keystoreFile =
-            new File("test/org/apache/tomcat/util/net/localhost.jks");
+            new File("debian/keystores/localhost.jks");
         connector.setAttribute(
                 "keystoreFile", keystoreFile.getAbsolutePath());
 
diff --git a/test/org/apache/tomcat/util/net/TesterSupport.java b/test/org/apache/tomcat/util/net/TesterSupport.java
index a55383b..ff6d775 100644
--- a/test/org/apache/tomcat/util/net/TesterSupport.java
+++ b/test/org/apache/tomcat/util/net/TesterSupport.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.InetAddress;
 import java.net.Socket;
+import java.net.URL;
 import java.net.URISyntaxException;
 import java.net.UnknownHostException;
 import java.security.KeyManagementException;
@@ -95,13 +96,13 @@ public final class TesterSupport {
             connector.setProperty("sslProtocol", "tls");
             
             java.net.URL keyStoreUrl =
-                    cl.getResource("org/apache/tomcat/util/net/" + keystore);
+                    getResourceURL("debian/keystores/" + keystore);
             File keystoreFile = toFile(keyStoreUrl);
             connector.setAttribute("keystoreFile",
                     keystoreFile.getAbsolutePath());
             
             java.net.URL truststoreUrl =
-                    cl.getResource("org/apache/tomcat/util/net/ca.jks");
+                    getResourceURL("debian/keystores/ca.jks");
             File truststoreFile = toFile(truststoreUrl);
             connector.setAttribute("truststoreFile",
                     truststoreFile.getAbsolutePath());
@@ -114,7 +115,7 @@ public final class TesterSupport {
             }
         } else {
             java.net.URL keyStoreUrl =
-                    cl.getResource("org/apache/tomcat/util/net/localhost-cert.pem");
+                    getResourceURL("debian/keystores/localhost-cert.pem");
             File keystoreFile = toFile(keyStoreUrl);
             tomcat.getConnector().setAttribute("SSLCertificateFile",
                     keystoreFile.getAbsolutePath());
@@ -140,7 +141,7 @@ public final class TesterSupport {
     protected static KeyManager[] getUser1KeyManagers() throws Exception {
         KeyManagerFactory kmf = KeyManagerFactory.getInstance(
                 KeyManagerFactory.getDefaultAlgorithm());
-        kmf.init(getKeyStore("org/apache/tomcat/util/net/user1.jks"),
+        kmf.init(getKeyStore("debian/keystores/user1.jks"),
                 "changeit".toCharArray());
         return kmf.getKeyManagers();
     }
@@ -148,7 +149,7 @@ public final class TesterSupport {
     protected static TrustManager[] getTrustManagers() throws Exception {
         TrustManagerFactory tmf = TrustManagerFactory.getInstance(
                 TrustManagerFactory.getDefaultAlgorithm());
-        tmf.init(getKeyStore("org/apache/tomcat/util/net/ca.jks"));
+        tmf.init(getKeyStore("debian/keystores/ca.jks"));
         return tmf.getTrustManagers();
     }
 
@@ -168,7 +169,7 @@ public final class TesterSupport {
 
     private static KeyStore getKeyStore(String keystore) throws Exception {
         ClassLoader cl = TesterSupport.class.getClassLoader();
-        java.net.URL keystoreUrl = cl.getResource(keystore);
+        java.net.URL keystoreUrl = getResourceURL(keystore);
         File keystoreFile = toFile(keystoreUrl);
         KeyStore ks = KeyStore.getInstance("JKS");
         InputStream is = null;
@@ -187,6 +188,16 @@ public final class TesterSupport {
         return ks;
     }
 
+    private static URL getResourceURL(String path) {
+        URL resourceURL = null;
+        try {
+            resourceURL = new File(path).toURI().toURL();
+        } catch (java.net.MalformedURLException e) {
+          // ignore and return null URL
+        }
+        return resourceURL;
+    }
+
     protected static boolean isRenegotiationSupported(Tomcat tomcat) {
         String protocol = tomcat.getConnector().getProtocolHandlerClassName();
         if (protocol.contains("Apr")) {
