-
Notifications
You must be signed in to change notification settings - Fork 42
Driver config reporting — stage 2: full DRIVER_CONFIG report #968
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
base: scylla-4.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,4 +37,23 @@ public interface SslEngineFactory extends AutoCloseable { | |
| */ | ||
| @NonNull | ||
| SSLEngine newSslEngine(@NonNull EndPoint remoteEndpoint); | ||
|
|
||
| /** | ||
| * Whether this factory validates the server certificate against the node's host name. | ||
| * | ||
| * <p>This is a diagnostic accessor (reported in the driver-configuration blob sent to the server | ||
| * at connection time); it does not affect how {@link #newSslEngine} behaves. | ||
| * | ||
| * <p>This method's default implementation returns {@code false}. The only reason it exists is to | ||
| * preserve binary compatibility. The driver's built-in factories override it to return their real | ||
| * value; the default is intentionally conservative because the driver cannot assume an arbitrary | ||
| * custom factory performs host name validation, and must not over-report a security control that | ||
| * may not actually be active. Custom factories that do validate should override this to report | ||
| * accurately. | ||
| * | ||
| * @since 4.19.2.1 | ||
| */ | ||
| default boolean requireHostnameValidation() { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| return false; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -191,14 +191,26 @@ Message getRequest() { | |
| return request = Options.INSTANCE; | ||
| case STARTUP: | ||
| Map<String, String> startupOptions = new HashMap<>(context.getStartupOptions()); | ||
| // Non-null sharding info is the driver's own proxy check for "this is ScyllaDB" (also | ||
| // used, independently, by CassandraSchemaQueries.shouldApplyUsingTimeout()). Detection | ||
| // only works once the OPTIONS/SUPPORTED handshake has populated featureStore, i.e. when | ||
| // querySupportedOptions is true (always the case today: ChannelFactory passes true for | ||
| // every connection) — featureStore itself is never actually null here. | ||
| boolean scyllaDb = false; | ||
| if (featureStore != null) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why check if comment above says it is never null here |
||
| featureStore.populateStartupOptions(startupOptions); | ||
| scyllaDb = featureStore.getShardingInfo() != null; | ||
| } | ||
| // The DRIVER_CONFIG blob describes the whole session, so only the control connection | ||
| // carries it (options.reportConfig); the other connections are correlated to it by the | ||
| // SESSION_ID that every connection already carries from context.getStartupOptions(). | ||
| // scyllaDb lets the report reflect ScyllaDB-only server-side behavior, e.g. the USING | ||
| // TIMEOUT clause on schema queries. No-op when driver config reporting is disabled. | ||
| if (options.reportConfig) { | ||
| context | ||
| .getDriverConfigReporter() | ||
| .populateControlConnectionOptions(startupOptions, scyllaDb); | ||
| } | ||
| // Adds SESSION_ID on every connection and DRIVER_CONFIG on the control connection | ||
| // (options.reportConfig); no-op when driver config reporting is disabled. | ||
| context | ||
| .getDriverConfigReporter() | ||
| .populateStartupOptions(startupOptions, options.reportConfig); | ||
| return request = new Startup(startupOptions); | ||
| case GET_CLUSTER_NAME: | ||
| return request = CLUSTER_NAME_QUERY; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.