import java.util.Locale;
import java.util.concurrent.Executor;
+import javax.net.ssl.SSLEngine;
+
import org.apache.coyote.ActionCode;
import org.apache.coyote.Request;
import org.apache.coyote.RequestInfo;
import org.apache.tomcat.util.net.NioEndpoint;
import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment;
import org.apache.tomcat.util.net.SSLSupport;
+import org.apache.tomcat.util.net.SecureNioChannel;
import org.apache.tomcat.util.net.SocketStatus;
+import org.apache.tomcat.util.net.jsse.JSSEFactory;
/**
.setLimit(maxSavePostSize);
inputBuffer.addActiveFilter
(inputFilters[Constants.BUFFERED_FILTER]);
+ SecureNioChannel sslChannel = (SecureNioChannel) socket;
+ SSLEngine engine = sslChannel.getSslEngine();
+ if (!engine.getNeedClientAuth()) {
+ // Need to re-negotiate SSL connection
+ engine.setNeedClientAuth(true);
+ try {
+ sslChannel.rehandshake(endpoint.getSoTimeout());
+ sslSupport = (new JSSEFactory()).getSSLSupport(engine.getSession());
+ } catch (IOException ioe) {
+ log.warn(sm.getString("http11processor.socket.sslreneg",ioe));
+ }
+ }
+
try {
Object sslO = sslSupport.getPeerCertificateChain(true);
if( sslO != null) {
Tomcat tomcat = getTomcatInstance();
String protocol = tomcat.getConnector().getProtocolHandlerClassName();
- if (protocol.indexOf("Nio") != -1) {
- return; // Not supported yet (2011-03-01)
- }
if (protocol.indexOf("Apr") != -1) {
return; // Disabled by default in 1.1.20 windows binary (2010-07-27)
}