[SNOW-3249917] JDBC removal Step 11a (part 2): Replicate HttpUtil, swap callers#1144
Merged
sfc-gh-ggeng merged 3 commits intomasterfrom Apr 7, 2026
Merged
[SNOW-3249917] JDBC removal Step 11a (part 2): Replicate HttpUtil, swap callers#1144sfc-gh-ggeng merged 3 commits intomasterfrom
sfc-gh-ggeng merged 3 commits intomasterfrom
Conversation
Closed
2 tasks
72e1169 to
fa6f664
Compare
5a3650a to
372f22d
Compare
sfc-gh-alhuang
approved these changes
Apr 6, 2026
fa6f664 to
3d3b931
Compare
486d52f to
13967ca
Compare
3d3b931 to
9b2d8fb
Compare
2 tasks
…ap callers to replicated REST infrastructure Replicate JDBC's HttpUtil as JdbcHttpUtil (renamed to avoid collision with ingest's existing net.snowflake.ingest.utils.HttpUtil). Also replicate SnowflakeMutableProxyRoutePlanner and AttributeEnhancingHttpRequestRetryHandler as small helper classes. Key changes: - JdbcHttpUtil: verbatim replication of JDBC HttpUtil with import swaps. SFTrustManager replaced with null (ingest does not use OCSP trust manager). SFSSLConnectionSocketFactory -> IngestSSLConnectionSocketFactory. SystemUtil.convertSystemPropertyToIntValue inlined. SessionUtil.isNewRetryStrategyRequest inlined as static method. Deprecated S3 proxy wrapper methods omitted (S3HttpUtil callable directly). - RestRequest: all FQN net.snowflake.client.core.HttpUtil references replaced with JdbcHttpUtil. SessionUtil.isNewRetryStrategyRequest replaced with JdbcHttpUtil.isNewRetryStrategyRequest. - TelemetryClient: HttpUtil.executeGeneralRequest and HttpUtil.getSocketTimeout replaced with JdbcHttpUtil equivalents. SnowflakeSQLException import swapped to ingest's replicated version. - SnowflakeGCSClient: HttpUtil.getHttpClient, getHttpClientWithoutDecompression, getSocketTimeout replaced with JdbcHttpUtil equivalents. Added toIngestKey adapter to convert JDBC's HttpClientSettingsKey during transition. - SnowflakeAzureClient: setSessionlessProxyForAzure import swapped from JDBC HttpUtil to JdbcHttpUtil. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
13967ca to
f5c0fa5
Compare
Replicate SFTrustManager (1689 lines) and its dependencies so JdbcHttpUtil uses the real OCSP trust manager from the start, rather than temporarily stubbing it to null. New files: SFTrustManager, Constants, FileCacheManager, HexUtil, OCSPTelemetryData. Updated: JdbcHttpUtil (use real SFTrustManager), FileUtil (add methods needed by FileCacheManager), IngestSSLConnectionSocketFactory, S3HttpUtil, StorageClientUtil. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 tasks
SFTrustManager uses BouncyCastle's bcutil (ASN1, OCSP types). It was a transitive dependency but maven-dependency-plugin:analyze-only requires it to be declared explicitly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replicate JDBC's HttpUtil as
JdbcHttpUtil(avoids name collision with ingest's existingHttpUtil), swap all callers, and replicate SFTrustManager + dependencies so OCSP verification works from the start.17 files changed, +3810/-52
New files — HTTP infrastructure
JdbcHttpUtil(1146 lines) — replicated from JDBC'sHttpUtil. HTTP client creation, proxy configuration, request executionSnowflakeMutableProxyRoutePlanner— proxy route planner for Apache HttpClientAttributeEnhancingHttpRequestRetryHandler— HTTP request retry handler with context attributesNew files — OCSP trust manager + dependencies
SFTrustManager(1689 lines) — SSL trust manager for OCSP certificate verificationFileCacheManager— OCSP response cacheOCSPTelemetryData— OCSP telemetry eventsConstants— shared constantsHexUtil— hex encoding utilityCaller swaps
RestRequest: swap FQNnet.snowflake.client.core.HttpUtil→JdbcHttpUtilTelemetryClient: replaceHttpUtil.executeGeneralRequest()→JdbcHttpUtilSnowflakeGCSClient: replaceHttpUtil.getHttpClient*()andRestRequestFQN refs → replicated versionsSnowflakeAzureClient: swapsetSessionlessProxyForAzurestatic import →JdbcHttpUtilUpdated files
FileUtil— additional methods needed by FileCacheManagerIngestSSLConnectionSocketFactory— use replicated SFTrustManagerS3HttpUtil— use replicated utilitiesStorageClientUtil— addsystemGetEnvmethodStacked on #1143.
Replication Verification Diff Report
All classes are line-by-line replications of JDBC v3.25.1 sources. Common permitted mechanical differences across all files:
net.snowflake.ingest.streaming.internal.fileTransferAgentSFLogger/SFLoggerFactory→ ingest's replicated versions inlogsubpackage@SnowflakeJdbcInternalApiannotations removedAttributeEnhancingHttpRequestRetryHandler
JDBC source :
net/snowflake/client/core/AttributeEnhancingHttpRequestRetryHandler.java@ v3.25.1Unexpected differences: NONE
JdbcHttpUtil (JDBC: HttpUtil)
JDBC source :
net/snowflake/client/core/HttpUtil.java@ v3.25.1Permitted differences (mechanical):
HttpUtil→JdbcHttpUtil(all self-references updated)SFSSLConnectionSocketFactory→IngestSSLConnectionSocketFactorySnowflakeDriver.implementVersion→SnowflakeDriverConstants.implementVersion@SnowflakeJdbcInternalApiannotations removedUnexpected differences:
SystemUtil.convertSystemPropertyToIntValueinlined as local method (lines 1134-1156). Safe: body matches JDBCSystemUtil.java@ v3.25.1 verbatim.SessionUtil.isNewRetryStrategyRequestinlined as local method (lines 1158-1186). Safe: body matches JDBCSessionUtil.java@ v3.25.1 verbatim. All 5 path constants match (/session/v1/login-request,/session/authenticator-request,/session/token-request,/api/v1/authn,/sso/saml).SnowflakeMutableProxyRoutePlanner
JDBC source :
net/snowflake/client/core/SnowflakeMutableProxyRoutePlanner.java@ v3.25.1Unexpected differences: NONE
SFTrustManager
JDBC source :
net/snowflake/client/core/SFTrustManager.java@ v3.25.1Permitted differences (mechanical):
Unexpected differences:
HttpUtil.SFConnectionSocketFactory→JdbcHttpUtil.SFConnectionSocketFactory(line 597). Safe: expected rename from HttpUtil → JdbcHttpUtil.Constants
JDBC source :
net/snowflake/client/core/Constants.java@ v3.25.1Permitted differences (mechanical):
SnowflakeUtil.systemGetProperty→StorageClientUtil.systemGetPropertyUnexpected differences: NONE
FileCacheManager
JDBC source :
net/snowflake/client/core/FileCacheManager.java@ v3.25.1Permitted differences (mechanical):
Unexpected differences: NONE
HexUtil
JDBC source :
net/snowflake/client/core/HexUtil.java@ v3.25.1Unexpected differences: NONE
OCSPTelemetryData
JDBC source :
net/snowflake/client/core/OCSPTelemetryData.java@ v3.25.1Permitted differences (mechanical):
OCSPMode→net.snowflake.ingest.utils.OCSPMode(explicit import, was same-package in JDBC)TelemetryServicenow same-package (import removed)Unexpected differences: NONE
Test plan
mvn compiler:compilepasses🤖 Generated with Claude Code