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 2019/09/05 14:53:08 UTC

[httpcomponents-core] branch HTTPCORE-595 created (now 547655d)

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a change to branch HTTPCORE-595
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git.


      at 547655d  HTTPCORE-595: tolerate NPE thrown by com.android.org.conscrypt.NativeCrypto#SSL_get_shutdown in Android Conscript

This branch includes the following new commits:

     new 547655d  HTTPCORE-595: tolerate NPE thrown by com.android.org.conscrypt.NativeCrypto#SSL_get_shutdown in Android Conscript

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[httpcomponents-core] 01/01: HTTPCORE-595: tolerate NPE thrown by com.android.org.conscrypt.NativeCrypto#SSL_get_shutdown in Android Conscript

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch HTTPCORE-595
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit 547655dfcb618da138cdaffe337a7126715dc4a2
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Thu Sep 5 16:52:34 2019 +0200

    HTTPCORE-595: tolerate NPE thrown by com.android.org.conscrypt.NativeCrypto#SSL_get_shutdown in Android Conscript
---
 .../main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
index e302bbc..708978b 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
@@ -683,9 +683,15 @@ public class SSLIOSession implements IOSession {
                     this.session.setSocketTimeout(Timeout.ofMilliseconds(1000));
                 }
                 try {
+                    // Catch all unchecked exceptions in case something goes wrong
+                    // in the JSSE provider. For instance
+                    // com.android.org.conscrypt.NativeCrypto#SSL_get_shutdown can
+                    // throw NPE at this point
                     updateEventMask();
                 } catch (final CancelledKeyException ex) {
-                    close(CloseMode.GRACEFUL);
+                    this.session.close(CloseMode.GRACEFUL);
+                } catch (final Exception ex) {
+                    this.session.close(CloseMode.IMMEDIATE);
                 }
             } else {
                 if (this.status == CLOSED) {