Skip to content

Commit

Permalink
Set appropriate value to requestedEncryptionLevel for encrypt=STRICT
Browse files Browse the repository at this point in the history
  • Loading branch information
machavan committed Feb 7, 2025
1 parent 25ea8da commit 4dbaeee
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4147,7 +4147,11 @@ void prelogin(String serverName, int portNumber) throws SQLServerException {
final byte fedAuthOffset;
if (fedAuthRequiredByUser) {
messageLength = TDS.B_PRELOGIN_MESSAGE_LENGTH_WITH_FEDAUTH;
requestedEncryptionLevel = TDS.ENCRYPT_ON;
if (encryptOption.compareToIgnoreCase(EncryptOption.STRICT.toString()) == 0) {
requestedEncryptionLevel = TDS.ENCRYPT_NOT_SUP;

Check warning on line 4151 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#L4151

Added line #L4151 was not covered by tests
} else {
requestedEncryptionLevel = TDS.ENCRYPT_ON;
}

// since we added one more line for prelogin option with fedauth,
// we also needed to modify the offsets above, by adding 5 to each offset,
Expand Down

0 comments on commit 4dbaeee

Please sign in to comment.