Handle TLS session upgrade failures

This commit is contained in:
Oleg Kalnichevski 2019-09-30 20:13:23 +02:00
parent 90c07f3490
commit 7d523e9113
1 changed files with 12 additions and 7 deletions

View File

@ -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);
}