Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 89530 invoked from network); 8 Nov 2006 06:32:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Nov 2006 06:32:37 -0000 Received: (qmail 77865 invoked by uid 500); 8 Nov 2006 06:32:43 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 77762 invoked by uid 500); 8 Nov 2006 06:32:43 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 77729 invoked by uid 99); 8 Nov 2006 06:32:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 22:32:42 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [203.25.40.70] (HELO rrmailscan1.safenetbox.biz) (203.25.40.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 22:32:28 -0800 Received: from rrmailscan1.safenetbox.biz (rrmailscan1.safenetbox.biz [127.0.0.1]) by rrmailscan1.safenetbox.biz (Postfix) with ESMTP id E0535304125 for ; Wed, 8 Nov 2006 17:32:38 +1100 (EST) Received: from andrewf (unknown [10.30.149.33]) (Authenticated sender: remote) by rrmailscan1.safenetbox.biz (Postfix) with ESMTP id 49FFD3040D1 for ; Wed, 8 Nov 2006 17:32:38 +1100 (EST) From: "Andrew Friebel" To: Subject: Extracting SSL information from servlet Date: Wed, 8 Nov 2006 17:37:05 +1100 Message-ID: <006601c70300$4ea26f60$21951e0a@andrewf> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0067_01C7035C.8212E760" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Importance: Normal X-Virus-Checked: Checked by ClamAV on apache.org ------=_NextPart_000_0067_01C7035C.8212E760 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I hope I have submitted this question via the correct mechanism. I wish to extract certificate information from my servlet that is running within tomcat. The problem that I get is that my x509 certificate array is always null. The code snippet that I am attempting to use is: X509Certificate[] certs = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate"); if (certs == null) { // do non-ssl items } else { // Attempt to extract principal name from Subject: String clientDN = certs[0].getSubjectDN().getName(); System.out.println("Client DN = " + clientDN); } My understanding is that when I use the getAttribute as I have above, I am supposed to get an array of X509Certificate objects. Instead, certs is always null. Any ideas? Regards, Andrew Friebel Franchise Services Franchise Product Development Coordinator Reynolds & Reynolds ------------------------------------ Ph: +613 9535 2222 Fax: +613 9535 2281 andrewf@reynolds.com.au reynolds.com.au partsales.com.au carservice.com.au ------=_NextPart_000_0067_01C7035C.8212E760--