-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-28520][runtime] RestClient doesn't use SNI TLS extension #20808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9b87914 to
68e013e
Compare
68e013e to
2830789
Compare
e4ea2cb to
2d54c4c
Compare
e2af8df to
0997524
Compare
6b4a9d5 to
7ccbf55
Compare
2d2134b to
ff64ef0
Compare
762072e to
d645f41
Compare
d645f41 to
009a1b9
Compare
009a1b9 to
f32e97c
Compare
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
|
||
| /** Ssl cases for {@link RestClient} and {@link RestServerEndpoint}. */ | ||
| public class RestClientSslTest extends TestLogger { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an integration test.
|
|
||
| private static String sniHostReceived; | ||
|
|
||
| static { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This static magic can have serious effect on other tests so just must be solved in a different way.
|
|
||
| /** Name Service to add fake DNS entry. */ | ||
| @SuppressWarnings("restriction") | ||
| public static class LocalHostNameService implements sun.net.spi.nameservice.NameService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does sun.net.spi.nameservice.NameService exists in IBM JVM for portability?
|
|
||
| final SSLHandlerFactory sslHandlerFactory = restConfiguration.getSslHandlerFactory(); | ||
| ChannelInitializer<SocketChannel> initializer = | ||
| new ChannelInitializer<SocketChannel>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a new ChannelInitializer per request sound like perf degradation. Have you measured how much?
| } | ||
| } | ||
| }; | ||
| bootstrap.handler(initializer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this function not called from multiple threads? Now we introduce race here...
|
Not needed anymore for our use case |
What is the purpose of the change
This pull request makes the RestClient us of the TLS SNI extension
Brief change log
The RestClient create the socket when the target Host and Port is known instead of during instanciation.
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation