Permalink
Browse files

HTTPCORE-319: terminate non-blocking SSLIOSession if the SSL handshak…

…e is aborted by the oppositve endpoint leaving the SSL engine in the NEED_UNWRAP state

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk@1435369 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 3d5b578 commit f9b2a923b63193c4e4584b524ac5fad40c0d1852 @ok2c ok2c committed Jan 18, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
@@ -285,10 +285,16 @@ private void doHandshake() throws SSLException {
}
private void updateEventMask() {
+ // Graceful session termination
if (this.status == CLOSING && this.sslEngine.isOutboundDone()
&& (this.endOfStream || this.sslEngine.isInboundDone())) {
this.status = CLOSED;
}
+ // Abnormal session termination
+ if (this.status == ACTIVE && this.endOfStream
+ && this.sslEngine.getHandshakeStatus() == HandshakeStatus.NEED_UNWRAP) {
+ this.status = CLOSED;
+ }
if (this.status == CLOSED) {
this.session.close();
return;

0 comments on commit f9b2a92

Please sign in to comment.