protected void parseSocketInfo(Socket socket, WinstoneRequest req)
throws IOException {
super.parseSocketInfo(socket, req);
if (socket instanceof SSLSocket) {
SSLSocket s = (SSLSocket) socket;
SSLSession ss = s.getSession();
if (ss != null) {
Certificate certChain[] = null;
try {
certChain = ss.getPeerCertificates();
} catch (Throwable err) {/* do nothing */
}
if (certChain != null) {
req.setAttribute("javax.servlet.request.X509Certificate",
certChain);
req.setAttribute("javax.servlet.request.cipher_suite", ss
.getCipherSuite());
req.setAttribute("javax.servlet.request.ssl_session",
new String(ss.getId()));
req.setAttribute("javax.servlet.request.key_size",
getKeySize(ss.getCipherSuite()));
}
}
req.setIsSecure(true);
}
}