Skip to content

Commit c0f0952

Browse files
Explicitly set the netty SSL Provider to JDK
This is copy of the PR#116 from prestodb/airlift. This code uses the FATAL_ALERT failure behavior, which is only supported by the JDK ssl provider. However, if no SSL Provider is set, it is environment dependent whether the JDK or OpenSSL provider is used. This change Explicitly sets the ssl provider to JDK. This fixes an issue where servers might fail on start up in ReferenceCountedOpenSslContext with "OpenSSL provider does not support FATAL_ALERT behavior" if they get created with OPEN_SSL as the provider.
1 parent 5b295fd commit c0f0952

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drift-transport-netty/src/main/java/com/facebook/drift/transport/netty/ssl/ReloadableSslContext.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import io.netty.handler.ssl.ApplicationProtocolConfig.SelectorFailureBehavior;
2626
import io.netty.handler.ssl.SslContext;
2727
import io.netty.handler.ssl.SslContextBuilder;
28+
import io.netty.handler.ssl.SslProvider;
2829

2930
import java.io.File;
3031
import java.io.IOException;
@@ -136,6 +137,7 @@ public synchronized void reload()
136137
// it should respond with a no_application_protocol alert and fail the TLS handshake.
137138
sslContextBuilder.applicationProtocolConfig(new ApplicationProtocolConfig(
138139
Protocol.ALPN, SelectorFailureBehavior.FATAL_ALERT, SelectedListenerFailureBehavior.FATAL_ALERT, new String[] {"thrift"}));
140+
sslContextBuilder.sslProvider(SslProvider.JDK);
139141
sslContext.set(new SslContextHolder(sslContextBuilder.build()));
140142
}
141143
}

0 commit comments

Comments
 (0)