You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by maxpade <ma...@yahoo.de> on 2011/09/29 10:42:46 UTC

Fetch SSL Client Certificate from AXIS-Request

Hi all,

i have set SSL-Client authentiaction for my AXIS-Webservice. Now i'm sending with SSL the client-certificate to authenticate at the server. How could i read the SSL-Certificates in AXIS while the transport handshake? 
Are there examples? 


Any suggestion would be great appreciated.

Thanks

maxpade

Re: Fetch SSL Client Certificate from AXIS-Request

Posted by Hasini Gunasinghe <ha...@gmail.com>.
Hi,

I believe you can access the client certificate in the following way from
axis2 message context when mutual authentication is enabled,

HttpServletRequest request = ((HttpServletRequest) *messageContext*
.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST));
X509CertImpl cert =
request.getAttribute("javax.servlet.request.X509Certificate");

You can refer relevant code snippet in [1] where client cert is looked for,
when validating transport in Rampart.
But above is possible after SSL handshake has taken place..

[1]
https://svn.apache.org/repos/asf/axis/axis2/java/rampart/trunk/modules/rampart-core/src/main/java/org/apache/rampart/util/RampartUtil.java

Thanks,
Hasini.



On Thu, Sep 29, 2011 at 2:12 PM, maxpade <ma...@yahoo.de> wrote:

> Hi all,
>
> i have set SSL-Client authentiaction for my AXIS-Webservice. Now i'm
> sending with SSL the client-certificate to authenticate at the server. How
> could i read the SSL-Certificates in AXIS while the transport handshake?
> Are there examples?
>
> Any suggestion would be great appreciated.
>
> Thanks
>
> maxpade
>