tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Nivens" <bniv...@visionarysystemsinc.com>
Subject Re: Servlet+SSL
Date Fri, 19 May 2000 16:19:30 GMT
The documentation for getAuthType says that it can return "Basic", "SSL", or null. I
haven't checked to see if it works.

Also, there is some code in the SnoopServlet that came with Java Web Server for checking
the cipher suite:
 String cipherSuite = (String) req.getAttribute ("javax.net.ssl.cipher_suite");

 if (cipherSuite != null) {
  X509Certificate certChain [] = (X509Certificate []) req.getAttribute
("javax.net.ssl.peer_certificates");

  out.println ("Cipher Suite:  " + cipherSuite);

  if (certChain != null) {
    for (int i = 0; i < certChain.length; i++) {
      out.println ("client cert chain [" + i + "] = " + certChain [i].toString ());
    }
  }
}

Does anyone know if this code would work under Tomcat? If it does, you could check to
see if the cipher suite is not null. Then you would know that you are using SSL.

Steve Stearns wrote:

> On Fri, 19 May 2000, Michael Hausding wrote:
> > Brian Nivens wrote:
> > > You could have each servlet and JSP page check HttpServletRequest.getAuthType(),
> > > and redirect all non-SSL to another page.
> > Is this working for you? I testet it and Request.getAuthType() always returns
> > null, and as far as I understand, it is not implemented yet. But you can use
> > request.getServerPort() to check if the request came to port 80 or 443.
>
> Request.getAuthType() has nothing to do with SSL.  The getAuthType method
> returns the type of authentication being used with the webserver.  If you
> secured directories using basic password authentication then you would get
> the value "basic" for example.
>
> ---Steve
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message