Results 1 to 7 of 7
  1. #1
    holyjohn is offline Member
    Join Date
    May 2010
    Posts
    7
    Rep Power
    0

    Unhappy Need guidance on X509Certificate, AxisEngine, MessageContext and HttpServletRequest

    I'm trying to figure out the problem of null exception of the code below:

    Java Code:
    MessageContext msgContext = AxisEngine.getCurrentMessageContext(); 
    
    HttpServletRequest req = (HttpServletRequest)msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
      
    X509Certificate x509certs[] = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate");
    x509certs[] is null. I'm trying to find out why...

    Do any1 of you pros out there know where i can get more information on X509Certificate, AxisEngine, MessageContext and HttpServletRequest?

    Is there any books or websites teaches people to use it?

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    I believe the servlet container will store the SSL certificate that was used in making a HTTPS connection as this request attribute on the servlet request object. So if the x509certs[] is null for you, this likely means the request was not invoked over a https connector.

    I am not entirely sure if mod_jk (when tomcat is connected to apache) would set this request attribute, or if this is only possible to have set if you invoked the request thru tomcat's HTTPS SSL connector.

    See also : Java 2 Platform EE v1.3: Interface ServletRequest

    that link is to jdk 1.3, but this part of the servlet api should not have changed.

  3. #3
    holyjohn is offline Member
    Join Date
    May 2010
    Posts
    7
    Rep Power
    0

    Default

    I don't know a single thing u talking about. HTTPS SSL?
    Can u lead me to some material like website, ebook and stuff, where i can study about it?

  4. #4
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

  5. #5
    holyjohn is offline Member
    Join Date
    May 2010
    Posts
    7
    Rep Power
    0

    Default

    Whao... I guess I have a lot reading todo. Gosh, my eye lips is getting heavier and heavier.

  6. #6
    holyjohn is offline Member
    Join Date
    May 2010
    Posts
    7
    Rep Power
    0

    Default

    Can u tell me what whether I'm right or wrong.

    Keystore - stores private key, certificates and certificate chain
    Truststore - stores CA in .cer format.

    Server-side
    ------
    Normally location of keystore are specified in server.xml
    truststore store under cacerts in jsdk/jre/lib/security.
    Server do no need to store its own certificate? only need to specified the keystore location?

    Client-side
    -----------
    user specified where to locate the keystore.
    what about truststore? For my existing system, it uses a file_trust.jks to store a certificate. The certificate store in file_trust.jks is client-side certificate or server?

  7. #7
    holyjohn is offline Member
    Join Date
    May 2010
    Posts
    7
    Rep Power
    0

    Default

    In the client program I only found

    Java Code:
    System.setProperty("javax.net.ssl.trustStore", trustStore);
    Where else, server-side got
    Java Code:
    X509Certificate x509certs[] = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate");
    I can't find any request.setAttribute(....);

    Inside truststore contain .cer, will it automatic access to truststore for X509Certificate? Can it be done like this?

Similar Threads

  1. Guidance needed
    By Curtiz in forum AWT / Swing
    Replies: 1
    Last Post: 03-23-2010, 05:41 PM
  2. Guidance in writing a compiler
    By Jeremy in forum Advanced Java
    Replies: 2
    Last Post: 11-28-2008, 11:25 PM
  3. Guidance
    By gizdev in forum New To Java
    Replies: 5
    Last Post: 09-07-2008, 07:14 PM
  4. Replies: 0
    Last Post: 01-28-2008, 09:00 AM
  5. HttpServletRequest request size
    By Ed in forum Java Servlet
    Replies: 2
    Last Post: 07-02-2007, 02:02 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •