remm 2005/07/13 06:03:51
Modified: http11/src/java/org/apache/coyote/http11
Http11AprProcessor.java
Log:
- Code cleanups and comments.
Revision Changes Path
1.25 +18 -10
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
Index: Http11AprProcessor.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- Http11AprProcessor.java 13 Jul 2005 11:05:19 -0000 1.24
+++ Http11AprProcessor.java 13 Jul 2005 13:03:51 -0000 1.25
@@ -1080,10 +1080,13 @@
try {
if (ssl) {
+ // Cipher suite
Object sslO = SSLSocket.getInfoS(socket,
SSL.SSL_INFO_CIPHER);
- if (sslO != null)
+ if (sslO != null) {
request.setAttribute
("javax.servlet.request.cipher_suite", sslO);
+ }
+ // Client certificate chain if present
int certLength = SSLSocket.getInfoI(socket,
SSL.SSL_INFO_CLIENT_CERT_CHAIN);
X509Certificate[] certs = null;
if (certLength > 0) {
@@ -1096,17 +1099,22 @@
certs[i] = (X509Certificate)
cf.generateCertificate(stream);
}
}
- if (certs != null)
+ if (certs != null) {
request.setAttribute
("javax.servlet.request.X509Certificate", certs);
+ }
+ // User key size
sslO = new Integer(SSLSocket.getInfoI(socket,
SSL.SSL_INFO_CIPHER_USEKEYSIZE));
- if (sslO != null)
+ if (sslO != null) {
request.setAttribute
("javax.servlet.request.key_size", sslO);
+ }
+ // SSL session ID
sslO = SSLSocket.getInfoS(socket,
SSL.SSL_INFO_SESSION_ID);
- if (sslO != null)
+ if (sslO != null) {
request.setAttribute
("javax.servlet.request.ssl_session", sslO);
+ }
}
} catch (Exception e) {
log.warn("Exception getting SSL attributes " ,e);
@@ -1115,18 +1123,17 @@
} else if (actionCode == ActionCode.ACTION_REQ_SSL_CERTIFICATE) {
if (ssl) {
- /*
- * Consume and buffer the request body, so that it does not
- * interfere with the client's handshake messages
- */
+ // Consume and buffer the request body, so that it does not
+ // interfere with the client's handshake messages
InputFilter[] inputFilters = inputBuffer.getFilters();
((BufferedInputFilter)
inputFilters[Constants.BUFFERED_FILTER])
.setLimit(maxSavePostSize);
inputBuffer.addActiveFilter
(inputFilters[Constants.BUFFERED_FILTER]);
try {
- // FIXME: Verify this is the right thing to do
+ // Renegociate certificates
SSLSocket.renegotiate(socket);
+ // Client certificate chain if present
int certLength = SSLSocket.getInfoI(socket,
SSL.SSL_INFO_CLIENT_CERT_CHAIN);
X509Certificate[] certs = null;
if (certLength > 0) {
@@ -1139,9 +1146,10 @@
certs[i] = (X509Certificate)
cf.generateCertificate(stream);
}
}
- if (certs != null)
+ if (certs != null) {
request.setAttribute
("javax.servlet.request.X509Certificate", certs);
+ }
} catch (Exception e) {
log.warn("Exception getting SSL Cert", e);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]