Skip to content

Conversation

@jd-hatzenbuhler
Copy link

@jd-hatzenbuhler jd-hatzenbuhler commented Sep 11, 2022

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:

  • Added integration tests to test TLS SNI extension

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): don't know
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: don't know
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

@flinkbot
Copy link
Collaborator

flinkbot commented Sep 11, 2022

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@jd-hatzenbuhler jd-hatzenbuhler changed the title [FLINK-28520] RestClient doesn't use SNI TLS extension [FLINK-28520][runtime] RestClient doesn't use SNI TLS extension Sep 11, 2022
@jd-hatzenbuhler jd-hatzenbuhler marked this pull request as ready for review September 11, 2022 14:54
@jd-hatzenbuhler jd-hatzenbuhler force-pushed the fix/FLINK-28520 branch 5 times, most recently from e4ea2cb to 2d54c4c Compare September 27, 2022 07:03
@jd-hatzenbuhler jd-hatzenbuhler force-pushed the fix/FLINK-28520 branch 5 times, most recently from e2af8df to 0997524 Compare October 4, 2022 16:12
@jd-hatzenbuhler jd-hatzenbuhler force-pushed the fix/FLINK-28520 branch 2 times, most recently from 6b4a9d5 to 7ccbf55 Compare October 17, 2022 07:16
@jd-hatzenbuhler jd-hatzenbuhler force-pushed the fix/FLINK-28520 branch 3 times, most recently from 2d2134b to ff64ef0 Compare November 10, 2022 17:17
@jd-hatzenbuhler
Copy link
Author

jd-hatzenbuhler commented Nov 13, 2022

ff64ef0 Azure: SUCCESS
762072e Azure: SUCCESS
d645f41 Azure: SUCCESS
009a1b9 Azure: SUCCESS

@jd-hatzenbuhler jd-hatzenbuhler force-pushed the fix/FLINK-28520 branch 2 times, most recently from 762072e to d645f41 Compare November 14, 2022 07:59
@MartijnVisser MartijnVisser requested review from zentol and removed request for zentol November 14, 2022 15:11
import static org.junit.jupiter.api.Assertions.assertEquals;

/** Ssl cases for {@link RestClient} and {@link RestServerEndpoint}. */
public class RestClientSslTest extends TestLogger {
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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>() {
Copy link
Contributor

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);
Copy link
Contributor

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...

@MartijnVisser MartijnVisser removed the request for review from zentol December 16, 2022 10:22
@jd-hatzenbuhler
Copy link
Author

Not needed anymore for our use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants