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/10/04 12:50:43 UTC
[httpcomponents-client] branch development created (now 7d523e9)
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a change to branch development
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git.
at 7d523e9 Handle TLS session upgrade failures
This branch includes the following new commits:
new 7d523e9 Handle TLS session upgrade failures
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-client] 01/01: Handle TLS session upgrade failures
Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch development
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
commit 7d523e911345a23b72e7557eb295578d56e1e6b3
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Mon Sep 30 20:13:23 2019 +0200
Handle TLS session upgrade failures
---
.../nio/DefaultAsyncClientConnectionOperator.java | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/DefaultAsyncClientConnectionOperator.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/DefaultAsyncClientConnectionOperator.java
index 1d2a8e9..6d89f2a 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/DefaultAsyncClientConnectionOperator.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/DefaultAsyncClientConnectionOperator.java
@@ -90,13 +90,18 @@ final class DefaultAsyncClientConnectionOperator implements AsyncClientConnectio
public void completed(final IOSession session) {
final DefaultManagedAsyncClientConnection connection = new DefaultManagedAsyncClientConnection(session);
if (tlsStrategy != null) {
- tlsStrategy.upgrade(
- connection,
- host,
- session.getLocalAddress(),
- session.getRemoteAddress(),
- attachment,
- connectTimeout);
+ try {
+ tlsStrategy.upgrade(
+ connection,
+ host,
+ session.getLocalAddress(),
+ session.getRemoteAddress(),
+ attachment,
+ connectTimeout);
+ } catch (final Exception ex) {
+ future.failed(ex);
+ return;
+ }
}
future.completed(connection);
}