Skip to content

Invalidate existing enclave session during connection (re)connect #2638

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

Merged
merged 7 commits into from
May 8, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2189,6 +2189,15 @@

long elapsedSeconds = 0;
long start = System.currentTimeMillis();

// Any existing enclave session would be invalid, make sure it is invalidated.
// For example, if this is a session recovery reconnect.
//
if (enclaveProvider != null) {
connectionlogger.fine("Invalidating existing enclave session");
enclaveProvider.invalidateEnclaveSession();

Check warning on line 2198 in src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java#L2197-L2198

Added lines #L2197 - L2198 were not covered by tests
}

for (int connectRetryAttempt = 0, tlsRetryAttempt = 0;;) {
try {
if (0 == elapsedSeconds || elapsedSeconds < loginTimeoutSeconds) {
Expand Down
Loading