aboutsummaryrefslogtreecommitdiff
path: root/www/apache-jserv/files/patch-ag
blob: b2ff44682907ac355dcfd7623ed0f33a554f163f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- src/java/org/apache/jserv/JServConnection.java.orig	Wed Feb  9 00:05:03 2000
+++ src/java/org/apache/jserv/JServConnection.java	Wed Feb  9 00:15:59 2000
@@ -1062,6 +1062,14 @@
      * known.
      */
     public String getRemoteUser() {
+        String type = getAuthType();
+        if(type == null) {
+            return (String) env_vars.get("REMOTE_USER");
+        } else if(type.equalsIgnoreCase("SSL")) {
+            String name = (String)env_vars.get("SSL_CLIENT_DN");
+            name = name.replace('/', ',');
+            return name.substring(1);
+        }
         return (String) env_vars.get("REMOTE_USER");
     }
 
@@ -1072,7 +1080,12 @@
      * @return this request's authentication scheme, or null if none.
      */
     public String getAuthType() {
-        return (String) env_vars.get("AUTH_TYPE");
+        String temp = (String) env_vars.get("SSL_CLIENT_DN");
+        if(temp != null && temp.equals("") == false) {
+            return "SSL";
+        } else {
+            return (String) env_vars.get("AUTH_TYPE");
+        }
     }
 
     /**