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 2018/12/07 15:53:09 UTC
[1/4] httpcomponents-core git commit: Bug fix: corrected handling of
graceful SSL session termination initiated by the opposite endpoint
(back-ported from master)
Repository: httpcomponents-core
Updated Branches:
refs/heads/4.4.x 6e7d82fbb -> 42757443e
Bug fix: corrected handling of graceful SSL session termination initiated by the opposite endpoint (back-ported from master)
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/01f3d30c
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/01f3d30c
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/01f3d30c
Branch: refs/heads/4.4.x
Commit: 01f3d30cfa3b1bf643a8ea5733fdd3bde8c56abd
Parents: 6e7d82f
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Dec 7 16:23:50 2018 +0100
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Dec 7 16:23:50 2018 +0100
----------------------------------------------------------------------
.../apache/http/nio/reactor/ssl/SSLIOSession.java | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/01f3d30c/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
index 8342bed..e9495ad 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
@@ -441,13 +441,16 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
final ByteBuffer inEncryptedBuf = this.inEncrypted.acquire();
// Perform operation
- final int ret = this.session.channel().read(inEncryptedBuf);
+ final int bytesRead = this.session.channel().read(inEncryptedBuf);
// Release if empty
if (inEncryptedBuf.position() == 0) {
this.inEncrypted.release();
}
- return ret;
+ if (bytesRead == -1) {
+ this.endOfStream = true;
+ }
+ return bytesRead;
}
private boolean decryptData() throws SSLException {
@@ -485,6 +488,9 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
}
}
}
+ if (this.sslEngine.isInboundDone()) {
+ this.endOfStream = true;
+ }
return decrypted;
}
@@ -496,10 +502,7 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
*/
public synchronized boolean isAppInputReady() throws IOException {
do {
- final int bytesRead = receiveEncryptedData();
- if (bytesRead == -1) {
- this.endOfStream = true;
- }
+ receiveEncryptedData();
doHandshake();
final HandshakeStatus status = this.sslEngine.getHandshakeStatus();
if (status == HandshakeStatus.NOT_HANDSHAKING || status == HandshakeStatus.FINISHED) {
[3/4] httpcomponents-core git commit: Bug fix: non-blocking SSL
session incorrectly stops decrypting incoming data if unwrap operation
results in NOT_HANDSHAKING status (back-ported from master)
Posted by ol...@apache.org.
Bug fix: non-blocking SSL session incorrectly stops decrypting incoming data if unwrap operation results in NOT_HANDSHAKING status (back-ported from master)
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/88383195
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/88383195
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/88383195
Branch: refs/heads/4.4.x
Commit: 88383195c9449b7d344cf3ccad12864b36789fa7
Parents: 08d9c3c
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Dec 7 16:31:04 2018 +0100
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Dec 7 16:31:04 2018 +0100
----------------------------------------------------------------------
.../main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java | 3 ---
1 file changed, 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/88383195/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
index 6cc7ba2..9575d99 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
@@ -482,9 +482,6 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
}
break;
}
- if (result.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING) {
- break;
- }
} finally {
// Release inEncrypted if empty
if (this.inEncrypted.acquire().position() == 0) {
Fwd: [4/4] httpcomponents-core git commit: Added openjdk10 to
Travis-CI build matrix
Posted by Gary Gregory <ga...@gmail.com>.
I think we can skip Java 9 and 10 and instead test Java 11. After all only
Java 8 and 11 have LTS ATM.
Gary
---------- Forwarded message ---------
From: <ol...@apache.org>
Date: Fri, Dec 7, 2018 at 8:53 AM
Subject: [4/4] httpcomponents-core git commit: Added openjdk10 to Travis-CI
build matrix
To: <co...@hc.apache.org>
Added openjdk10 to Travis-CI build matrix
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit:
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/42757443
Tree:
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/42757443
Diff:
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/42757443
Branch: refs/heads/4.4.x
Commit: 42757443e182d6a775cd2422b037520b54142016
Parents: 8838319
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Dec 7 16:52:21 2018 +0100
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Dec 7 16:52:21 2018 +0100
----------------------------------------------------------------------
.travis.yml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/42757443/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index c1335bd..b8c2f79 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,6 +19,7 @@ sudo: false
jdk:
- openjdk7
- oraclejdk8
+ - openjdk10
after_success:
- mvn clean cobertura:cobertura coveralls:report
Re: [4/4] httpcomponents-core git commit: Added openjdk10 to
Travis-CI build matrix
Posted by Gary Gregory <ga...@gmail.com>.
Dang it! :-) Thanks Matt!
Gary
On Fri, Dec 7, 2018 at 9:36 AM Matt Sicker <bo...@gmail.com> wrote:
> Yes, we probably could, though if you want HC to know, you should email
> them, too. ;)
>
> On Fri, 7 Dec 2018 at 10:27, Gary Gregory <ga...@gmail.com> wrote:
>
> > I think we can skip Java 9 and 10 and instead test Java 11.
> >
> > Gary
> >
> > ---------- Forwarded message ---------
> > From: <ol...@apache.org>
> > Date: Fri, Dec 7, 2018 at 8:53 AM
> > Subject: [4/4] httpcomponents-core git commit: Added openjdk10 to
> Travis-CI
> > build matrix
> > To: <co...@hc.apache.org>
> >
> >
> > Added openjdk10 to Travis-CI build matrix
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
> > Commit:
> >
> http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/42757443
> > Tree:
> > http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/42757443
> > Diff:
> > http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/42757443
> >
> > Branch: refs/heads/4.4.x
> > Commit: 42757443e182d6a775cd2422b037520b54142016
> > Parents: 8838319
> > Author: Oleg Kalnichevski <ol...@apache.org>
> > Authored: Fri Dec 7 16:52:21 2018 +0100
> > Committer: Oleg Kalnichevski <ol...@apache.org>
> > Committed: Fri Dec 7 16:52:21 2018 +0100
> >
> > ----------------------------------------------------------------------
> > .travis.yml | 1 +
> > 1 file changed, 1 insertion(+)
> > ----------------------------------------------------------------------
> >
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/42757443/.travis.yml
> > ----------------------------------------------------------------------
> > diff --git a/.travis.yml b/.travis.yml
> > index c1335bd..b8c2f79 100644
> > --- a/.travis.yml
> > +++ b/.travis.yml
> > @@ -19,6 +19,7 @@ sudo: false
> > jdk:
> > - openjdk7
> > - oraclejdk8
> > + - openjdk10
> >
> > after_success:
> > - mvn clean cobertura:cobertura coveralls:report
> >
>
>
> --
> Matt Sicker <bo...@gmail.com>
>
Re: [4/4] httpcomponents-core git commit: Added openjdk10 to
Travis-CI build matrix
Posted by Matt Sicker <bo...@gmail.com>.
Yes, we probably could, though if you want HC to know, you should email
them, too. ;)
On Fri, 7 Dec 2018 at 10:27, Gary Gregory <ga...@gmail.com> wrote:
> I think we can skip Java 9 and 10 and instead test Java 11.
>
> Gary
>
> ---------- Forwarded message ---------
> From: <ol...@apache.org>
> Date: Fri, Dec 7, 2018 at 8:53 AM
> Subject: [4/4] httpcomponents-core git commit: Added openjdk10 to Travis-CI
> build matrix
> To: <co...@hc.apache.org>
>
>
> Added openjdk10 to Travis-CI build matrix
>
>
> Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
> Commit:
> http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/42757443
> Tree:
> http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/42757443
> Diff:
> http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/42757443
>
> Branch: refs/heads/4.4.x
> Commit: 42757443e182d6a775cd2422b037520b54142016
> Parents: 8838319
> Author: Oleg Kalnichevski <ol...@apache.org>
> Authored: Fri Dec 7 16:52:21 2018 +0100
> Committer: Oleg Kalnichevski <ol...@apache.org>
> Committed: Fri Dec 7 16:52:21 2018 +0100
>
> ----------------------------------------------------------------------
> .travis.yml | 1 +
> 1 file changed, 1 insertion(+)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/42757443/.travis.yml
> ----------------------------------------------------------------------
> diff --git a/.travis.yml b/.travis.yml
> index c1335bd..b8c2f79 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -19,6 +19,7 @@ sudo: false
> jdk:
> - openjdk7
> - oraclejdk8
> + - openjdk10
>
> after_success:
> - mvn clean cobertura:cobertura coveralls:report
>
--
Matt Sicker <bo...@gmail.com>
Fwd: [4/4] httpcomponents-core git commit: Added openjdk10 to
Travis-CI build matrix
Posted by Gary Gregory <ga...@gmail.com>.
I think we can skip Java 9 and 10 and instead test Java 11.
Gary
---------- Forwarded message ---------
From: <ol...@apache.org>
Date: Fri, Dec 7, 2018 at 8:53 AM
Subject: [4/4] httpcomponents-core git commit: Added openjdk10 to Travis-CI
build matrix
To: <co...@hc.apache.org>
Added openjdk10 to Travis-CI build matrix
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit:
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/42757443
Tree:
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/42757443
Diff:
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/42757443
Branch: refs/heads/4.4.x
Commit: 42757443e182d6a775cd2422b037520b54142016
Parents: 8838319
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Dec 7 16:52:21 2018 +0100
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Dec 7 16:52:21 2018 +0100
----------------------------------------------------------------------
.travis.yml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/42757443/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index c1335bd..b8c2f79 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,6 +19,7 @@ sudo: false
jdk:
- openjdk7
- oraclejdk8
+ - openjdk10
after_success:
- mvn clean cobertura:cobertura coveralls:report
[4/4] httpcomponents-core git commit: Added openjdk10 to Travis-CI
build matrix
Posted by ol...@apache.org.
Added openjdk10 to Travis-CI build matrix
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/42757443
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/42757443
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/42757443
Branch: refs/heads/4.4.x
Commit: 42757443e182d6a775cd2422b037520b54142016
Parents: 8838319
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Dec 7 16:52:21 2018 +0100
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Dec 7 16:52:21 2018 +0100
----------------------------------------------------------------------
.travis.yml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/42757443/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index c1335bd..b8c2f79 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,6 +19,7 @@ sudo: false
jdk:
- openjdk7
- oraclejdk8
+ - openjdk10
after_success:
- mvn clean cobertura:cobertura coveralls:report
[2/4] httpcomponents-core git commit: Bug fix: corrected handling of
NEED_WRAP handshake status during graceful SSL session termination
(back-ported from master)
Posted by ol...@apache.org.
Bug fix: corrected handling of NEED_WRAP handshake status during graceful SSL session termination (back-ported from master)
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/08d9c3c3
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/08d9c3c3
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/08d9c3c3
Branch: refs/heads/4.4.x
Commit: 08d9c3c30d57def4963d0807bce5f3023f5fcb35
Parents: 01f3d30
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Dec 7 16:27:18 2018 +0100
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Dec 7 16:27:18 2018 +0100
----------------------------------------------------------------------
.../java/org/apache/http/nio/reactor/ssl/SSLIOSession.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/08d9c3c3/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
index e9495ad..6cc7ba2 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
@@ -300,7 +300,7 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
// Just wrap an empty buffer because there is no data to write.
result = doWrap(ByteBuffer.allocate(0), outEncryptedBuf);
- if (result.getStatus() != Status.OK) {
+ if (result.getStatus() != Status.OK || result.getHandshakeStatus() == HandshakeStatus.NEED_WRAP) {
handshaking = false;
}
break;
@@ -358,6 +358,10 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
private void updateEventMask() {
// Graceful session termination
+ if (this.status == ACTIVE
+ && (this.endOfStream || this.sslEngine.isInboundDone())) {
+ this.status = CLOSING;
+ }
if (this.status == CLOSING && !this.outEncrypted.hasData()) {
this.sslEngine.closeOutbound();
}