Author: remy.maucherat(a)jboss.com
Date: 2012-11-23 06:30:39 -0500 (Fri, 23 Nov 2012)
New Revision: 2130
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/net/jsse/NioJSSESupport.java
branches/7.2.x/src/main/java/org/apache/tomcat/util/net/jsse/SecureNioChannel.java
branches/7.2.x/webapps/docs/changelog.xml
Log:
Fix client-cert with NIO2.
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/net/jsse/NioJSSESupport.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/tomcat/util/net/jsse/NioJSSESupport.java 2012-11-21
09:54:34 UTC (rev 2129)
+++
branches/7.2.x/src/main/java/org/apache/tomcat/util/net/jsse/NioJSSESupport.java 2012-11-23
11:30:39 UTC (rev 2130)
@@ -217,12 +217,8 @@
* @throws IOException
*/
protected void handShake() throws IOException {
- if (channel != null && channel.handshakeComplete) {
- return;
- }
-
if (channel != null) {
- channel.handshake();
+ channel.reHandshake();
}
}
}
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/net/jsse/SecureNioChannel.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/tomcat/util/net/jsse/SecureNioChannel.java 2012-11-21
09:54:34 UTC (rev 2129)
+++
branches/7.2.x/src/main/java/org/apache/tomcat/util/net/jsse/SecureNioChannel.java 2012-11-23
11:30:39 UTC (rev 2130)
@@ -38,6 +38,7 @@
import javax.net.ssl.SSLSession;
import org.apache.tomcat.util.net.NioChannel;
+import org.jboss.web.CoyoteLogger;
/**
* {@code SecureNioChannel}
@@ -652,6 +653,15 @@
* @throws SSLException
*/
protected void reHandshake() throws SSLException {
+ if (sslEngine.getWantClientAuth()) {
+ CoyoteLogger.UTIL_LOGGER.debug("No client cert sent for want");
+ } else {
+ if (!sslEngine.getNeedClientAuth()) {
+ sslEngine.setNeedClientAuth(true);
+ } else {
+ CoyoteLogger.UTIL_LOGGER.debug("Already need client cert");
+ }
+ }
handshakeComplete = false;
handshakeStatus = sslEngine.getHandshakeStatus();
try {
Modified: branches/7.2.x/webapps/docs/changelog.xml
===================================================================
--- branches/7.2.x/webapps/docs/changelog.xml 2012-11-21 09:54:34 UTC (rev 2129)
+++ branches/7.2.x/webapps/docs/changelog.xml 2012-11-23 11:30:39 UTC (rev 2130)
@@ -29,6 +29,9 @@
<fix>
Additional NIO2 event fixes. (remm)
</fix>
+ <fix>
+ Fix NIO2 client certificate renegociation. (remm)
+ </fix>
</changelog>
</subsection>
</section>
Show replies by date