tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1804906 - /tomcat/trunk/test/org/apache/tomcat/util/net/TesterSupport.java
Date Sun, 13 Aug 2017 12:09:05 GMT
Author: rjung
Date: Sun Aug 13 12:09:04 2017
New Revision: 1804906

URL: http://svn.apache.org/viewvc?rev=1804906&view=rev
Log:
Replace hard-coded client certificate subject
by retrieving it from the certificate.

Modified:
    tomcat/trunk/test/org/apache/tomcat/util/net/TesterSupport.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TesterSupport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TesterSupport.java?rev=1804906&r1=1804905&r2=1804906&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/net/TesterSupport.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TesterSupport.java Sun Aug 13 12:09:04 2017
@@ -198,8 +198,16 @@ public final class TesterSupport {
 
         // Configure the Realm
         TesterMapRealm realm = new TesterMapRealm();
-        String cn = "CN=user1, OU=Apache Tomcat PMC, O=The Apache Software Foundation, "
+
-                "L=Wakefield, ST=WA, C=US";
+
+        String cn = "NOTFOUND";
+        try {
+            KeyStore ks = getKeyStore(CLIENT_JKS);
+            X509Certificate cert = (X509Certificate)ks.getCertificate(CLIENT_ALIAS);
+            cn = cert.getSubjectDN().getName();
+        } catch (Exception ex) {
+            // Ignore
+        }
+
         realm.addUser(cn, "not used");
         realm.addUserRole(cn, ROLE);
         ctx.setRealm(realm);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message