<%@page import="java.util.*"%> <%@page import="java.security.cert.*"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <% response.setHeader( "Pragma", "no-cache" ); response.setHeader( "Cache-Control", "no-cache" ); response.setDateHeader( "Expires", 0 ); %> SSL Information

Host Attributes!

Remote Host: <%= request.getRemoteHost() %>

Server Name: <%= request.getServerName() %>

Server Port: <%= request.getServerPort() %>

Scheme: <%= request.getScheme() %>

SSL Attributes!

SSL Session ID: <%= request.getAttribute("javax.servlet.request.ssl_session_id") %>

SSL Cipher: <%= request.getAttribute("javax.servlet.request.cipher_suite") %>

SSL Key size: <%= request.getAttribute("javax.servlet.request.key_size") %>

Certificate: <%= request.getAttribute("javax.servlet.request.X509Certificate") %>

Certificate size: <%= request.getAttribute("javax.servlet.request.X509Certificate") == null? "null" : ((X509Certificate[])request.getAttribute("javax.servlet.request.X509Certificate")).length %>

<% if (request.getAttribute("javax.servlet.request.X509Certificate") != null) { for (int i = 0; i < ((X509Certificate[])request.getAttribute("javax.servlet.request.X509Certificate")).length; i++) { %>

Certificate[<%= i %>]: <%= request.getAttribute("javax.servlet.request.X509Certificate") == null? "null" : ((X509Certificate[])request.getAttribute("javax.servlet.request.X509Certificate"))[i].getSubjectDN() %>

<% } CertificateFactory cf = CertificateFactory.getInstance("X.509"); List certs = Arrays.asList((X509Certificate[])request.getAttribute("javax.servlet.request.X509Certificate")); CertPath certPath = cf.generateCertPath(certs); out.print("

" + certPath.getCertificates() + "

"); } %>

Headers!

<% Enumeration headers = request.getHeaderNames(); while (headers.hasMoreElements()) { String name = headers.nextElement(); String value = request.getHeader(name); %>

<%= name %>: <%= value %>

<% } %>