You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2007/03/13 10:47:09 UTC
svn commit: r517619 -
/jakarta/httpcomponents/httpcore/trunk/module-niossl/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java
Author: olegk
Date: Tue Mar 13 02:47:08 2007
New Revision: 517619
URL: http://svn.apache.org/viewvc?view=rev&rev=517619
Log:
HTTPCORE-55: Fixed hostname verification callback invocation
Contributed by Asankha C. Perera <asankha at wso2.com>
Modified:
jakarta/httpcomponents/httpcore/trunk/module-niossl/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java
Modified: jakarta/httpcomponents/httpcore/trunk/module-niossl/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-niossl/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java?view=diff&rev=517619&r1=517618&r2=517619
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-niossl/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-niossl/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java Tue Mar 13 02:47:08 2007
@@ -129,18 +129,12 @@
}
this.sslEngine.beginHandshake();
doHandshake();
-
- if (this.handler != null) {
- this.handler.verify(
- this.session.getRemoteAddress(),
- this.sslEngine.getSession());
- }
}
private void doHandshake() throws SSLException {
boolean handshaking = true;
- SSLEngineResult result;
+ SSLEngineResult result = null;
while (handshaking) {
switch (this.sslEngine.getHandshakeStatus()) {
case NEED_WRAP:
@@ -174,6 +168,17 @@
case NOT_HANDSHAKING:
handshaking = false;
break;
+ }
+ }
+
+ // The SSLEngine has just finished handshaking. This value is only generated by a call
+ // to SSLEngine.wrap()/unwrap() when that call finishes a handshake.
+ // It is never generated by SSLEngine.getHandshakeStatus().
+ if (result != null && result.getHandshakeStatus() == HandshakeStatus.FINISHED) {
+ if (this.handler != null) {
+ this.handler.verify(
+ this.session.getRemoteAddress(),
+ this.sslEngine.getSession());
}
}
}