Posts

Showing posts from March, 2007

Apache mod_ssl tomcate Axis https user authentication

package com.tiandao.ws.util; import java.io.ByteArrayInputStream; import java.security.Principal; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import javax.servlet.ServletContext; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import org.apache.axis.MessageContext; import org.apache.axis.transport.http.HTTPConstants; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; public class AxisUtil { /** * This method read all possible certificate from request. If the apache * passes certificate to tomcate in "SSL_CLIENT_CERT", this method will * reads and create the certificate. * * @param request * @return */ public static X509Certificate getX509Certificate(HttpServletRequest request) { X509Certificate ret = null; String certString =