Skip to content

Commit cc49611

Browse files
SNOW-2240640 Set OCSP server for chunk downloader (#2299)
1 parent 38f5daf commit cc49611

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/main/java/net/snowflake/client/jdbc/SnowflakeChunkDownloader.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,15 @@ public SnowflakeChunkDownloader(SnowflakeResultSetSerializableV1 resultSetSerial
234234
this.prefetchMaxRetry = (int) prefetchMaxRetry;
235235
}
236236
}
237+
238+
if (resultSetSerializable.getServerURL() != null) {
239+
try {
240+
SessionUtil.resetOCSPUrlIfNecessary(resultSetSerializable.getServerURL());
241+
} catch (IOException e) {
242+
logger.debug("Exception while resetting OCSP URL", e);
243+
}
244+
}
245+
237246
this.memoryLimit = resultSetSerializable.getMemoryLimit();
238247
if (this.session != null
239248
&& session.getMemoryLimitForTesting() != SFBaseSession.MEMORY_LIMIT_UNSET) {

src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetSerializableV1.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public String toString() {
142142
// Below fields are from session or statement
143143
SnowflakeConnectString snowflakeConnectionString;
144144
OCSPMode ocspMode;
145+
String serverUrl;
145146
HttpClientSettingsKey httpClientKey;
146147
int networkTimeoutInMilli;
147148
int authTimeout;
@@ -220,6 +221,7 @@ private SnowflakeResultSetSerializableV1(SnowflakeResultSetSerializableV1 toCopy
220221
// Below fields are from session or statement
221222
this.snowflakeConnectionString = toCopy.snowflakeConnectionString;
222223
this.ocspMode = toCopy.ocspMode;
224+
this.serverUrl = toCopy.serverUrl;
223225
this.httpClientKey = toCopy.httpClientKey;
224226
this.networkTimeoutInMilli = toCopy.networkTimeoutInMilli;
225227
this.authTimeout = toCopy.authTimeout;
@@ -428,6 +430,7 @@ protected SnowflakeResultSetSerializableV1(
428430

429431
// setup fields from sessions.
430432
this.ocspMode = sfSession.getOCSPMode();
433+
this.serverUrl = sfSession.getServerUrl();
431434
this.httpClientKey = sfSession.getHttpClientKey();
432435
this.snowflakeConnectionString = sfSession.getSnowflakeConnectionString();
433436
this.networkTimeoutInMilli = sfSession.getNetworkTimeoutInMilli();
@@ -523,6 +526,10 @@ public OCSPMode getOCSPMode() {
523526
return ocspMode;
524527
}
525528

529+
public String getServerURL() {
530+
return serverUrl;
531+
}
532+
526533
public HttpClientSettingsKey getHttpClientKey() {
527534
return httpClientKey;
528535
}

0 commit comments

Comments
 (0)