- 37869: Also use the SSL_INFO_CLIENT_CERT field if the chain is empty.
authorremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 18 Dec 2006 23:16:46 +0000 (23:16 +0000)
committerremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 18 Dec 2006 23:16:46 +0000 (23:16 +0000)
- Submitted by Grzegorz Grzybek.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@488453 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/http11/Http11AprProcessor.java

index 8d05ae7..ccb3095 100644 (file)
@@ -1145,6 +1145,15 @@ public class Http11AprProcessor implements ActionHook {
                             ByteArrayInputStream stream = new ByteArrayInputStream(data);
                             certs[i] = (X509Certificate) cf.generateCertificate(stream);
                         }
+                    } else if (certLength == 0) {
+                        byte[] data = SSLSocket.getInfoB(socket, SSL.SSL_INFO_CLIENT_CERT);
+                        if (data != null) {
+                            certs = new X509Certificate[1];
+                            CertificateFactory cf =
+                                CertificateFactory.getInstance("X.509");
+                            ByteArrayInputStream stream = new ByteArrayInputStream(data);
+                            certs[0] = (X509Certificate) cf.generateCertificate(stream);
+                        }
                     }
                     if (certs != null) {
                         request.setAttribute
@@ -1192,6 +1201,15 @@ public class Http11AprProcessor implements ActionHook {
                             ByteArrayInputStream stream = new ByteArrayInputStream(data);
                             certs[i] = (X509Certificate) cf.generateCertificate(stream);
                         }
+                    } else if (certLength == 0) {
+                        byte[] data = SSLSocket.getInfoB(socket, SSL.SSL_INFO_CLIENT_CERT);
+                        if (data != null) {
+                            certs = new X509Certificate[1];
+                            CertificateFactory cf =
+                                CertificateFactory.getInstance("X.509");
+                            ByteArrayInputStream stream = new ByteArrayInputStream(data);
+                            certs[0] = (X509Certificate) cf.generateCertificate(stream);
+                        }
                     }
                     if (certs != null) {
                         request.setAttribute