Repository: microsoft/mssql-jdbc
Pull request #1757 (2022-02-23 05:13:27)

TDSS Support
this adds TDSS support via a breaking change to encrypt connection property to string type and adding the option "strict"

lilgreenbird: /azp run public-mssql-jdbc.windows
azure-pipelines[bot]: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
lilgreenbird: /azp run public-mssql-jdbc.linux
azure-pipelines[bot]: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
lilgreenbird: /azp run public-mssql-jdbc.windows
azure-pipelines[bot]: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
lilgreenbird: /azp run public-mssql-jdbc.windows
azure-pipelines[bot]: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
lilgreenbird: /azp run public-mssql-jdbc.windows
azure-pipelines[bot]: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>

Patch:
diff --git a/README.md b/README.md
index 9810741e..9d1a9dd8 100644
--- a/README.md
+++ b/README.md
@@ -80,7 +80,7 @@ We're now on the Maven Central Repository. Add the following to your POM file to
 <dependency>
 	<groupId>com.microsoft.sqlserver</groupId>
 	<artifactId>mssql-jdbc</artifactId>
-	<version>10.2.0.jre17</version>
+	<version>11.1.0.jre17</version>
 </dependency>
 ```
 The driver can be downloaded from [Microsoft](https://aka.ms/downloadmssqljdbc).
@@ -91,7 +91,7 @@ To get the latest version of the driver, add the following to your POM file:
 <dependency>
 	<groupId>com.microsoft.sqlserver</groupId>
 	<artifactId>mssql-jdbc</artifactId>
-	<version>10.2.0.jre17</version>
+	<version>11.1.0.jre17</version>
 </dependency>
 ```
 
@@ -126,7 +126,7 @@ Projects that require either of the two features need to explicitly declare the
 <dependency>
 	<groupId>com.microsoft.sqlserver</groupId>
 	<artifactId>mssql-jdbc</artifactId>
-	<version>10.2.0.jre17</version>
+	<version>11.1.0.jre17</version>
 	<scope>compile</scope>
 </dependency>
 
@@ -144,7 +144,7 @@ Projects that require either of the two features need to explicitly declare the
 <dependency>
 	<groupId>com.microsoft.sqlserver</groupId>
 	<artifactId>mssql-jdbc</artifactId>
-	<version>10.2.0.jre17</version>
+	<version>11.1.0.jre17</version>
 	<scope>compile</scope>
 </dependency>
 
@@ -171,7 +171,7 @@ When setting 'useFmtOnly' property to 'true' for establishing a connection or cr
 <dependency>
 	<groupId>com.microsoft.sqlserver</groupId>
 	<artifactId>mssql-jdbc</artifactId>
-	<version>10.2.0.jre17</version>
+	<version>11.1.0.jre17</version>
 </dependency>
 
 <dependency>
@@ -211,7 +211,7 @@ Preview releases happen approximately monthly between stable releases. This give
 You can see what is going into a future release by monitoring [Milestones](https://github.com/Microsoft/mssql-jdbc/milestones) in the repository.
 
 ### Version conventions
-Starting with 6.0, stable versions have an even minor version. For example, 6.0, 6.2, 6.4, 7.0, 7.2, 7.4, 8.2, 8.4, 9.2, 9.4. Preview versions have an odd minor version. For example, 6.1, 6.3, 6.5, 7.1, 7.3, 8.1, 9.1 and so on.
+Starting with 6.0, stable versions have an even minor version. For example, 6.0, 6.2, 6.4, 7.0, 7.2, 7.4, 8.2, 8.4, 9.2, 9.4. Preview versions have an odd minor version. For example, 6.1, 6.3, 6.5, 7.1, 7.3, 8.1, 9.1, 10.1, 11.1, and so on.
 
 ## Contributors 
 Special thanks to everyone who has contributed to the project. 
diff --git a/build.gradle b/build.gradle
index 4dd8723d..e611b200 100644
--- a/build.gradle
+++ b/build.gradle
@@ -11,7 +11,7 @@
 
 apply plugin: 'java'
 
-version = '10.3.0-SNAPSHOT'
+version = '11.1.0-SNAPSHOT'
 def jreVersion = ""
 def testOutputDir = file("build/classes/java/test")
 def archivesBaseName = 'mssql-jdbc'
diff --git a/mssql-jdbc_auth_LICENSE b/mssql-jdbc_auth_LICENSE
index 310e0f56..ada85dc9 100644
--- a/mssql-jdbc_auth_LICENSE
+++ b/mssql-jdbc_auth_LICENSE
@@ -1,5 +1,5 @@
 MICROSOFT SOFTWARE LICENSE TERMS
-MICROSOFT JDBC DRIVER 10.2 FOR SQL SERVER
+MICROSOFT JDBC DRIVER 11.1 FOR SQL SERVER
 
 These license terms are an agreement between you and Microsoft Corporation (or one of its affiliates). They apply to the software named above and any Microsoft services or software updates (except to the extent such services or updates are accompanied by new or additional terms, in which case those different terms apply prospectively and do not alter your or Microsoft’s rights relating to pre-updated software or services). IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW.  BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS.
 
diff --git a/pom.xml b/pom.xml
index 290bcc5f..d278f7ee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
 
 	<groupId>com.microsoft.sqlserver</groupId>
 	<artifactId>mssql-jdbc</artifactId>
-	<version>10.3.0-SNAPSHOT</version>
+	<version>11.1.0-SNAPSHOT</version>
 	<packaging>jar</packaging>
 
 	<name>Microsoft JDBC Driver for SQL Server</name>
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java b/src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
index c0fe5b46..d242a44b 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
@@ -761,7 +761,6 @@ final class TDSChannel implements Serializable {
         channelSocket = tcpSocket = socketFinder.findSocket(host, port, timeoutMillis, useParallel, useTnir,
                 isTnirFirstAttempt, timeoutMillisForFullTimeout);
         try {
-
             // Set socket options
             tcpSocket.setTcpNoDelay(true);
             tcpSocket.setKeepAlive(true);
@@ -1828,8 +1827,8 @@ final class TDSChannel implements Serializable {
      *        Private key file's password
      * @throws SQLServerException
      */
-    void enableSSL(String host, int port, String clientCertificate, String clientKey,
-            String clientKeyPassword) throws SQLServerException {
+    void enableSSL(String host, int port, String clientCertificate, String clientKey, String clientKeyPassword,
+            boolean isTDSS) throws SQLServerException {
         // If enabling SSL fails, which it can for a number of reasons, the following items
         // are used in logging information to the TDS channel logger to help diagnose the problem.
         Provider tmfProvider = null; // TrustManagerFactory provider
@@ -1870,12 +1869,11 @@ final class TDSChannel implements Serializable {
                 validateFips(trustStoreType, trustStoreFileName);
             }
 
-            assert TDS.ENCRYPT_OFF == con.getRequestedEncryptionLevel() || // Login only SSL
-                    TDS.ENCRYPT_ON == con.getRequestedEncryptionLevel(); // Full SSL
-
-            assert TDS.ENCRYPT_OFF == con.getNegotiatedEncryptionLevel() || // Login only SSL
-                    TDS.ENCRYPT_ON == con.getNegotiatedEncryptionLevel() || // Full SSL
-                    TDS.ENCRYPT_REQ == con.getNegotiatedEncryptionLevel(); // Full SSL
+            byte requestedEncryptLevel = con.getRequestedEncryptionLevel();
+            assert TDS.ENCRYPT_OFF == requestedEncryptLevel || // Login only SSL
+                    TDS.ENCRYPT_ON == requestedEncryptLevel || // Full SSL
+                    TDS.ENCRYPT_REQ == requestedEncryptLevel || // Full SSL
+                    (isTDSS && TDS.ENCRYPT_NOT_SUP == requestedEncryptLevel); // TDSS
 
             // If encryption wasn't negotiated or trust server certificate is specified,
             // then we'll "validate" the server certificate using a naive TrustManager that trusts
@@ -2004,13 +2002,17 @@ final class TDSChannel implements Serializable {
             // Got the SSL context. Now create an SSL socket over our own proxy socket
             // which we can toggle between TDS-encapsulated and raw communications.
             // Initially, the proxy is set to encapsulate the SSL handshake in TDS packets.
-            proxySocket = new ProxySocket(this);
-
             if (logger.isLoggable(Level.FINEST))
                 logger.finest(toString() + " Creating SSL socket");
 
-            // don't close proxy when SSL socket is closed
-            sslSocket = (SSLSocket) sslContext.getSocketFactory().createSocket(proxySocket, host, port, false);
+            proxySocket = new ProxySocket(this);
+
+            if (isTDSS) {
+                sslSocket = (SSLSocket) sslContext.getSocketFactory().createSocket(host, port);
+            } else {
+                // don't close proxy when SSL socket is closed
+                sslSocket = (SSLSocket) sslContext.getSocketFactory().createSocket(proxySocket, host, port, false);
+            }
 
             // At long last, start the SSL handshake ...
             if (logger.isLoggable(Level.FINER))
@@ -2053,6 +2055,7 @@ final class TDSChannel implements Serializable {
 
             if (logger.isLoggable(Level.FINER))
                 logger.finer(toString() + " SSL enabled");
+
         } catch (Exception e) {
             // Log the original exception and its source at FINER level
             if (logger.isLoggable(Level.FINER))
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java
index 76db4be5..0102e6ea 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java
@@ -101,23 +101,32 @@ public interface ISQLServerDataSource extends javax.sql.CommonDataSource {
     boolean getLastUpdateCount();
 
     /**
-     * Sets a Boolean value that indicates if the encrypt property is enabled.
+     * Sets the option whether TLS encryption is used.
      * 
-     * @param encrypt
-     *        true if the Secure Sockets Layer (SSL) encryption is enabled between the client and the SQL Server.
-     *        Otherwise, false.
+     * @param encryptOption
+     *        TLS encrypt option. Default is "true"
      */
-    void setEncrypt(boolean encrypt);
+    void setEncrypt(String encryptOption);
 
     /**
-     * Returns a Boolean value that indicates if the encrypt property is enabled.
+     * Sets the option whether TLS encryption is used.
      * 
-     * @return true if encrypt is enabled. Otherwise, false.
+     * @deprecated Use {@link ISQLServerDataSource#setEncrypt(String encryptOption)} instead
+     * @param encryptOption
+     *        TLS encrypt option. Default is true
      */
-    boolean getEncrypt();
+    @Deprecated
+    void setEncrypt(boolean encryptOption);
+
+    /**
+     * Returns the TLS encryption option.
+     * 
+     * @return the TLS encrypt option
+     */
+    String getEncrypt();
 
     /**
-     * Sets the value to enable/disable Transparent Netowrk IP Resolution (TNIR). Beginning in version 6.0 of the
+     * Sets the value to enable/disable Transparent Network IP Resolution (TNIR). Beginning in version 6.0 of the
      * Microsoft JDBC Driver for SQL Server, a new connection property transparentNetworkIPResolution (TNIR) is added
      * for transparent connection to Always On availability groups or to a server which has multiple IP addresses
      * associated. When transparentNetworkIPResolution is true, the driver attempts to connect to the first IP address
@@ -143,18 +152,20 @@ public interface ISQLServerDataSource extends javax.sql.CommonDataSource {
     boolean getTransparentNetworkIPResolution();
 
     /**
-     * Sets a Boolean value that indicates if the trustServerCertificate property is enabled.
+     * Sets a boolean value that indicates if the trustServerCertificate property is enabled.
      * 
      * @param e
      *        true, if the server Secure Sockets Layer (SSL) certificate should be automatically trusted when the
-     *        communication layer is encrypted using SSL. Otherwise, false.
+     *        communication layer is encrypted using SSL. false, if server SLL certificate should not be trusted
+     *        certificate location, if encrypt=strict
      */
     void setTrustServerCertificate(boolean e);
 
     /**
-     * Returns a Boolean value that indicates if the trustServerCertificate property is enabled.
+     * Returns a boolean value that indicates if the trustServerCertificate property is enabled.
      * 
-     * @return true if trustServerCertificate is enabled. Otherwise, false.
+     * @return true if trustServerCertificate is enabled. Otherwise, false. If encrypt=strict, returns server
+     *         certificate location
      */
     boolean getTrustServerCertificate();
 
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLJdbcVersion.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLJdbcVersion.java
index 195e1b5c..b1fa3d40 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLJdbcVersion.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLJdbcVersion.java
@@ -6,8 +6,8 @@
 package com.microsoft.sqlserver.jdbc;
 
 final class SQLJdbcVersion {
-    static final int major = 10;
-    static final int minor = 3;
+    static final int major = 11;
+    static final int minor = 1;
     static final int patch = 0;
     static final int build = 0;
     /*
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkRecord.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkRecord.java
index 3f27ee12..bfcf51ef 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkRecord.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkRecord.java
@@ -15,6 +15,7 @@ import java.util.Map.Entry;
  * Abstract class that implements ISQLServerBulkRecord
  *
  */
+@SuppressWarnings("deprecation")
 abstract class SQLServerBulkRecord implements ISQLServerBulkRecord {
 
     /**
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java
index 1171a613..acc07ae9 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java
@@ -196,13 +196,13 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
     /** Engine Edition 11 = Azure Synapse serverless SQL pool */
     private final int ENGINE_EDITION_SQL_AZURE_SYNAPSE_SERVERLESS_SQL_POOL = 11;
 
-    /** flag indicated whether server is Azure */
+    /** flag indicating whether server is Azure */
     private Boolean isAzure = null;
 
-    /** flag indicated whether server is Azure DW */
+    /** flag indicating whether server is Azure DW */
     private Boolean isAzureDW = null;
 
-    /** flag indicated whether server is Azure MI */
+    /** flag indicating whether server is Azure MI */
     private Boolean isAzureMI = null;
 
     /** shared timer */
@@ -214,6 +214,9 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
     /** connect retry interval */
     private int connectRetryInterval = 0;
 
+    /** flag indicating whether prelogin TLS handshake is required */
+    private boolean isTDSS = false;
+
     /**
      * Return an existing cached SharedTimer associated with this Connection or create a new one.
      *
@@ -743,9 +746,10 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
         return requestedEncryptionLevel;
     }
 
-    /** trust server certificate */
+    /** flag indicating whether to trust server certificate */
     private boolean trustServerCertificate;
 
+    /** return whether to trust server certificate */
     final boolean trustServerCertificate() {
         return trustServerCertificate;
     }
@@ -754,7 +758,7 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
     private byte negotiatedEncryptionLevel = TDS.ENCRYPT_INVALID;
 
     final byte getNegotiatedEncryptionLevel() {
-        assert TDS.ENCRYPT_INVALID != negotiatedEncryptionLevel;
+        assert (!isTDSS ? TDS.ENCRYPT_INVALID != negotiatedEncryptionLevel : true);
         return negotiatedEncryptionLevel;
     }
 
@@ -795,6 +799,9 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
     /** column encryption setting */
     String columnEncryptionSetting = null;
 
+    /** encrypt option */
+    String encryptOption = null;
+
     boolean isColumnEncryptionSettingEnabled() {
         return (columnEncryptionSetting.equalsIgnoreCase(ColumnEncryptionSetting.Enabled.toString()));
     }
@@ -2045,6 +2052,7 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
                 }
                 transparentNetworkIPResolution = isBooleanPropertyOn(sPropKey, sPropValue);
 
+                sPropKey = SQLServerDriverStringProperty.ENCRYPT.toString();
                 sPropKey = SQLServerDriverStringProperty.PREPARE_METHOD.toString();
                 sPropValue = activeConnectionProperties.getProperty(sPropKey);
                 if (null == sPropValue) {
@@ -2053,20 +2061,13 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
                 }
                 setPrepareMethod(PrepareMethod.valueOfString(sPropValue).toString());
 
-                sPropKey = SQLServerDriverBooleanProperty.ENCRYPT.toString();
+                sPropKey = SQLServerDriverStringProperty.ENCRYPT.toString();
                 sPropValue = activeConnectionProperties.getProperty(sPropKey);
                 if (null == sPropValue) {
-                    sPropValue = Boolean.toString(SQLServerDriverBooleanProperty.ENCRYPT.getDefaultValue());
+                    sPropValue = SQLServerDriverStringProperty.ENCRYPT.getDefaultValue();
                     activeConnectionProperties.setProperty(sPropKey, sPropValue);
                 }
-
-                socketFactoryClass = activeConnectionProperties
-                        .getProperty(SQLServerDriverStringProperty.SOCKET_FACTORY_CLASS.toString());
-                socketFactoryConstructorArg = activeConnectionProperties
-                        .getProperty(SQLServerDriverStringProperty.SOCKET_FACTORY_CONSTRUCTOR_ARG.toString());
-
-                // Set requestedEncryptionLevel according to the value of the encrypt connection property
-                requestedEncryptionLevel = isBooleanPropertyOn(sPropKey, sPropValue) ? TDS.ENCRYPT_ON : TDS.ENCRYPT_OFF;
+                encryptOption = EncryptOption.valueOfString(sPropValue).toString();
 
                 sPropKey = SQLServerDriverBooleanProperty.TRUST_SERVER_CERTIFICATE.toString();
                 sPropValue = activeConnectionProperties.getProperty(sPropKey);
@@ -2075,8 +2076,33 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
                             .toString(SQLServerDriverBooleanProperty.TRUST_SERVER_CERTIFICATE.getDefaultValue());
                     activeConnectionProperties.setProperty(sPropKey, sPropValue);
                 }
-
                 trustServerCertificate = isBooleanPropertyOn(sPropKey, sPropValue);
+
+                // Set requestedEncryptionLevel according to the value of the encrypt connection property
+                if (encryptOption.compareToIgnoreCase(EncryptOption.False.toString()) == 0) {
+                    requestedEncryptionLevel = TDS.ENCRYPT_OFF;
+                } else if (encryptOption.compareToIgnoreCase(EncryptOption.True.toString()) == 0) {
+                    requestedEncryptionLevel = TDS.ENCRYPT_ON;
+                } else if (encryptOption.compareToIgnoreCase(EncryptOption.Strict.toString()) == 0) {
+                    // this is necessary so we don't encrypt again
+                    requestedEncryptionLevel = TDS.ENCRYPT_NOT_SUP;
+
+                    if (trustServerCertificate) {
+                        if (loggerExternal.isLoggable(Level.FINER))
+                            loggerExternal.finer(toString() + " ignore trustServerCertificate for strict");
+                    }
+                    // do not trust server cert for strict
+                    trustServerCertificate = false;
+
+                    // prelogin TLS handshake is required
+                    isTDSS = true;
+                } else {
+                    MessageFormat form = new MessageFormat(
+                            SQLServerException.getErrString("R_InvalidConnectionSetting"));
+                    Object[] msgArgs = {"encrypt", encryptOption};
+                    throw new SQLServerException(null, form.format(msgArgs), null, 0, false);
+                }
+
                 trustManagerClass = activeConnectionProperties
                         .getProperty(SQLServerDriverStringProperty.TRUST_MANAGER_CLASS.toString());
                 trustManagerConstructorArg = activeConnectionProperties
@@ -2088,6 +2114,11 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
                     sPropValue = SQLServerDriverStringProperty.SELECT_METHOD.getDefaultValue();
                 }
 
+                socketFactoryClass = activeConnectionProperties
+                        .getProperty(SQLServerDriverStringProperty.SOCKET_FACTORY_CLASS.toString());
+                socketFactoryConstructorArg = activeConnectionProperties
+                        .getProperty(SQLServerDriverStringProperty.SOCKET_FACTORY_CONSTRUCTOR_ARG.toString());
+
                 if ("cursor".equalsIgnoreCase(sPropValue) || "direct".equalsIgnoreCase(sPropValue)) {
                     sPropValue = sPropValue.toLowerCase(Locale.ENGLISH);
                     activeConnectionProperties.setProperty(sPropKey, sPropValue);
@@ -2721,9 +2752,7 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
 
             activeConnectionProperties.remove(SQLServerDriverStringProperty.TRUST_STORE_PASSWORD.toString());
         }
-
         return this;
-
     }
 
     /**
@@ -3185,6 +3214,7 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
 
         // if the timeout is infinite slices are infinite too.
         tdsChannel = new TDSChannel(this);
+
         InetSocketAddress inetSocketAddress = tdsChannel.open(serverInfo.getParsedServerName(),
                 serverInfo.getPortNumber(), (0 == timeOutFullInSeconds) ? 0 : timeOutSliceInMillis, useParallel,
                 useTnir, isTnirFirstAttempt, timeOutsliceInMillisForFullTimeout);
@@ -3202,15 +3232,20 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
             }
             clientConnectionId = UUID.randomUUID();
         }
-
         assert null != clientConnectionId;
 
-        Prelogin(serverInfo.getServerName(), serverInfo.getPortNumber());
+        if (isTDSS) {
+            tdsChannel.enableSSL(serverInfo.getParsedServerName(), serverInfo.getPortNumber(), clientCertificate,
+                    clientKey, clientKeyPassword, isTDSS);
+            clientKeyPassword = "";
+        }
+
+        prelogin(serverInfo.getServerName(), serverInfo.getPortNumber());
 
-        // If prelogin negotiated SSL encryption then, enable it on the TDS channel.
-        if (TDS.ENCRYPT_NOT_SUP != negotiatedEncryptionLevel) {
+        // If not enabled already and prelogin negotiated SSL encryption then, enable it on the TDS channel.
+        if (!isTDSS && TDS.ENCRYPT_NOT_SUP != negotiatedEncryptionLevel) {
             tdsChannel.enableSSL(serverInfo.getParsedServerName(), serverInfo.getPortNumber(), clientCertificate,
-                    clientKey, clientKeyPassword);
+                    clientKey, clientKeyPassword, false);
             clientKeyPassword = "";
         }
 
@@ -3251,7 +3286,7 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
     /**
      * Negotiates prelogin information with the server.
      */
-    void Prelogin(String serverName, int portNumber) throws SQLServerException {
+    void prelogin(String serverName, int portNumber) throws SQLServerException {
         // Build a TDS Pre-Login packet to send to the server.
         if ((!authenticationString.equalsIgnoreCase(SqlAuthentication.NotSpecified.toString()))
                 || (null != accessTokenInByte)) {
@@ -3317,7 +3352,8 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
                 // Build (Little Endian), 2 bytes
                 (byte) (SQLJdbcVersion.build & 0xff), (byte) ((SQLJdbcVersion.build & 0xff00) >> 8),
 
-                // - Encryption -
+                // Encryption
+                // turn encryption off for TDSS since it's already enabled
                 (null == clientCertificate) ? requestedEncryptionLevel
                                             : (byte) (requestedEncryptionLevel | TDS.ENCRYPT_CLIENT_CERT),
 
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java
index 817236ea..669a190e 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java
@@ -306,14 +306,21 @@ public class SQLServerDataSource
     }
 
     @Override
-    public void setEncrypt(boolean encrypt) {
-        setBooleanProperty(connectionProps, SQLServerDriverBooleanProperty.ENCRYPT.toString(), encrypt);
+    public void setEncrypt(String encryptOption) {
+        setStringProperty(connectionProps, SQLServerDriverStringProperty.ENCRYPT.toString(), encryptOption);
     }
 
     @Override
-    public boolean getEncrypt() {
-        return getBooleanProperty(connectionProps, SQLServerDriverBooleanProperty.ENCRYPT.toString(),
-                SQLServerDriverBooleanProperty.ENCRYPT.getDefaultValue());
+    @Deprecated
+    public void setEncrypt(boolean encryptOption) {
+        setStringProperty(connectionProps, SQLServerDriverStringProperty.ENCRYPT.toString(),
+                Boolean.toString(encryptOption));
+    }
+
+    @Override
+    public String getEncrypt() {
+        return getStringProperty(connectionProps, SQLServerDriverStringProperty.ENCRYPT.toString(),
+                SQLServerDriverStringProperty.ENCRYPT.getDefaultValue());
     }
 
     @Override
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDatabaseMetaData.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDatabaseMetaData.java
index a16fe339..5cc2e2fd 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDatabaseMetaData.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDatabaseMetaData.java
@@ -1666,7 +1666,8 @@ public final class SQLServerDatabaseMetaData implements java.sql.DatabaseMetaDat
             if (!name.equals(SQLServerDriverBooleanProperty.INTEGRATED_SECURITY.toString())
                     && !name.equals(SQLServerDriverStringProperty.USER.toString())
                     && !name.equals(SQLServerDriverStringProperty.PASSWORD.toString())
-                    && !name.equals(SQLServerDriverStringProperty.KEY_STORE_SECRET.toString())) {
+                    && !name.equals(SQLServerDriverStringProperty.KEY_STORE_SECRET.toString())
+                    && !name.equals(SQLServerDriverStringProperty.TRUST_STORE_PASSWORD.toString())) {
                 String val = info[index].value;
                 // skip empty strings
                 if (0 != val.length()) {
diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java
index 1e11fe20..ff123be9 100644
--- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java
+++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java
@@ -44,8 +44,8 @@ final class SQLServerDriverPropertyInfo {
     }
 
     DriverPropertyInfo build(Properties connProperties) {
-        String propValue = name
-                .equals(SQLServerDriverStringProperty.PASSWORD.toString()) ? "" : connProperties.getProperty(name);
+        String propValue = name.equals(SQLServerDriverStringProperty.PASSWORD.toString()) ? "" : connProperties
+                .getProperty(name);
 
         if (null == propValue)
             propValue = defaultValue;
@@ -121,6 +121,45 @@ enum ColumnEncryptionSetting {
 }
 
 
+enum EncryptOption {
+    False,
+    No,
+    Optional,
+    True,
+    Mandatory,
+    Strict;
+
+    static EncryptOption valueOfString(String value) throws SQLServerException {
+        EncryptOption option = null;
+
+        String val = value.toLowerCase(Locale.US);
+        if (val.equalsIgnoreCase(EncryptOption.False.toString()) || val.equalsIgnoreCase(EncryptOption.No.toString())
+                || val.equalsIgnoreCase(EncryptOption.Optional.toString())) {
+            option = EncryptOption.False;
+        } else if (val.equalsIgnoreCase(EncryptOption.True.toString())
+                || val.equalsIgnoreCase(EncryptOption.Mandatory.toString())) {
+            option = EncryptOption.True;
+        } else if (val.equalsIgnoreCase(EncryptOption.Strict.toString())) {
+            option = EncryptOption.Strict;
+        } else {
+            MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_InvalidConnectionSetting"));
+            Object[] msgArgs = {"EncryptOption", value};
+            throw new SQLServerException(form.format(msgArgs), null);
+        }
+        return option;
+    }
+
+    static boolean isValidEncryptOption(String option) {
+        for (EncryptOption t : EncryptOption.values()) {
+            if (option.equalsIgnoreCase(t.toString())) {
+                return true;
+            }
+        }
+        return false;
+    }
+}
+
+
 enum AttestationProtocol {
     HGS("HGS"),
     AAS("AAS");
@@ -181,7 +220,8 @@ enum SSLProtocol {
     TLS("TLS"),
     TLS_V10("TLSv1"),
     TLS_V11("TLSv1.1"),
-    TLS_V12("TLSv1.2"),;
+    TLS_V12("TLSv1.2"),
+    TLS_V13("TLSv1.3"),;
 
     private final String name;
 
@@ -205,6 +245,8 @@ enum SSLProtocol {
             protocol = SSLProtocol.TLS_V11;
         } else if (value.toLowerCase(Locale.ENGLISH).equalsIgnoreCase(SSLProtocol.TLS_V12.toString())) {
             protocol = SSLProtocol.TLS_V12;
+        } else if (value.toLowerCase(Locale.ENGLISH).equalsIgnoreCase(SSLProtocol.TLS_V13.toString())) {
+            protocol = SSLProtocol.TLS_V13;
         } else {
             MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_invalidSSLProtocol"));
             Object[] msgArgs = {value};
@@ -334,8 +376,9 @@ enum SQLServerDriverObjectProperty {
     }
 }
 
+
 enum PrepareMethod {
-    PREPEXEC("prepexec"), //sp_prepexec, default prepare method
+    PREPEXEC("prepexec"), // sp_prepexec, default prepare method
     PREPARE("prepare");
 
     private final String value;
@@ -364,6 +407,7 @@ enum PrepareMethod {
     }
 }
 
+
 enum SQLServerDriverStringProperty {
     APPLICATION_INTENT("applicationIntent", ApplicationIntent.READ_WRITE.toString()),
     APPLICATION_NAME("applicationName", SQLServerDriver.DEFAULT_APP_NAME),
@@ -408,7 +452,8 @@ enum SQLServerDriverStringProperty {
     CLIENT_KEY_PASSWORD("clientKeyPassword", ""),
     AAD_SECURE_PRINCIPAL_ID("AADSecurePrincipalId", ""),
     AAD_SECURE_PRINCIPAL_SECRET("AADSecurePrincipalSecret", ""),
-    MAX_RESULT_BUFFER("maxResultBuffer", "-1");
+    MAX_RESULT_BUFFER("maxResultBuffer", "-1"),
+    ENCRYPT("encrypt", EncryptOption.True.toString());
 
     private final String name;
     private final String defaultValue;
@@ -476,7 +521,6 @@ enum SQLServerDriverIntProperty {
 
 enum SQLServerDriverBooleanProperty {
     DISABLE_STATEMENT_POOLING("disableStatementPooling", true),
-    ENCRYPT("encrypt", true),
     INTEGRATED_SECURITY("integratedSecurity", false),
     LAST_UPDATE_COUNT("lastUpdateCount", true),
     MULTI_SUBNET_FAILOVER("multiSubnetFailover", false),
@@ -524,6 +568,7 @@ public final class SQLServerDriver implements java.sql.Driver {
     static final String DEFAULT_APP_NAME = "Microsoft JDBC Driver for SQL Server";
 
     private static final String[] TRUE_FALSE = {"true", "false"};
+
     private static final SQLServerDriverPropertyInfo[] DRIVER_PROPERTIES = {
             // default required available choices
             // property name value property (if appropriate)
@@ -545,11 +590,14 @@ public final class SQLServerDriver implements java.sql.Driver {
             new SQLServerDriverPropertyInfo(SQLServerDriverBooleanProperty.DISABLE_STATEMENT_POOLING.toString(),
                     Boolean.toString(SQLServerDriverBooleanProperty.DISABLE_STATEMENT_POOLING.getDefaultValue()), false,
                     new String[] {"true"}),
+            new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.ENCRYPT.toString(),
+                    SQLServerDriverStringProperty.ENCRYPT.getDefaultValue(), false,
+                    new String[] {EncryptOption.False.toString(), EncryptOption.No.toString(),
+                            EncryptOption.Optional.toString(), EncryptOption.True.toString(),
+                            EncryptOption.Mandatory.toString(), EncryptOption.Strict.toString()}),
             new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.PREPARE_METHOD.toString(),
-                    SQLServerDriverStringProperty.PREPARE_METHOD.getDefaultValue(),false,
+                    SQLServerDriverStringProperty.PREPARE_METHOD.getDefaultValue(), false,
                     new String[] {PrepareMethod.PREPEXEC.toString(), PrepareMethod.PREPARE.toString()}),
-            new SQLServerDriverPropertyInfo(SQLServerDriverBooleanProperty.ENCRYPT.toString(),
-                    Boolean.toString(SQLServerDriverBooleanProperty.ENCRYPT.getDefaultValue()), false, TRUE_FALSE),
             new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.FAILOVER_PARTNER.toString(),
                     SQLServerDriverStringProperty.FAILOVER_PARTNER.getDefaultValue(), false, null),
             new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.HOSTNAME_IN_CERTIFICATE.toString(),
@@ -627,8 +675,7 @@ public final class SQLServerDriver implements java.sql.Driver {
             new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.TRUST_MANAGER_CONSTRUCTOR_ARG.toString(),
                     SQLServerDriverStringProperty.TRUST_MANAGER_CONSTRUCTOR_ARG.getDefaultValue(), false, null),
             new SQLServerDriverPropertyInfo(SQLServerDriverBooleanProperty.REPLICATION.toString(),
-                    Boolean.toString(SQLServerDriverBooleanProperty.REPLICATION.getDefaultValue()), false,
-                    TRUE_FALSE),
+                    Boolean.toString(SQLServerDriverBooleanProperty.REPLICATION.getDefaultValue()), false, TRUE_FALSE),
             new SQLServerDriverPropertyInfo(SQLServerDriverBooleanProperty.SEND_TIME_AS_DATETIME.toString(),
                     Boolean.toString(SQLServerDriverBooleanProperty.SEND_TIME_AS_DATETIME.getDefaultValue()), false,
                     TRUE_FALSE),
@@ -734,7 +781,8 @@ public final class SQLServerDriver implements java.sql.Driver {
             {"domainName", SQLServerDriverStringProperty.DOMAIN.toString()},
             {"port", SQLServerDriverIntProperty.PORT_NUMBER.toString()}};
     static private final AtomicInteger baseID = new AtomicInteger(0); // Unique id generator for each instance (used for
-                                                                      // logging).
+                                                                      // logging
+
     final private int instanceID; // Unique id for this instance.
     final private String traceID;
 
@@ -936,10 +984,10 @@ public final class SQLServerDriver implements java.sql.Driver {
         return null;
     }
 
-    private final static String[] systemPropertiesToLog = new String[] { "java.specification.vendor",
+    private final static String[] systemPropertiesToLog = new String[] {"java.specification.vendor",
             "java.specification.version", "java.class.path", "java.class.version", "java.runtime.name",
             "java.runtime.version", "java.vendor", "java.version", "java.vm.name", "java.vm.vendor", "java.vm.version",
-            "java.vm.specification.vendor", "java.vm.specification.version", "os.name", "os.version", "os.arch" };
+            "java.vm.specification.vendor", "java.vm.specification.version", "os.name", "os.version", "os.arch"};
 
     @Override
     public java.sql.Connection connect(String Url, Properties suppliedProperties) throws SQLServerException {
@@ -947,8 +995,10 @@ public final class SQLServerDriver implements java.sql.Driver {
         SQLServerConnection result = null;
 
         if (loggerExternal.isLoggable(Level.FINE)) {
-            loggerExternal.log(Level.FINE, "Microsoft JDBC Driver " + SQLJdbcVersion.major + "." + SQLJdbcVersion.minor +
-                    "." + SQLJdbcVersion.patch + "." + SQLJdbcVersion.build + SQLJdbcVersion.releaseExt + " for SQL Server");
+            loggerExternal.log(Level.FINE,
+                    "Microsoft JDBC Driver " + SQLJdbcVersion.major + "." + SQLJdbcVersion.minor + "."
+                            + SQLJdbcVersion.patch + "." + SQLJdbcVersion.build + SQLJdbcVersion.releaseExt
+                            + " for SQL Server");
             if (loggerExternal.isLoggable(Level.FINER)) {
                 for (String propertyKeyName : systemPropertiesToLog) {
                     String propertyValue = System.getProperty(propertyKeyName);
diff --git a/src/samples/adaptive/pom.xml b/src/samples/adaptive/pom.xml
index dc7781ac..9f5b10b1 100644
--- a/src/samples/adaptive/pom.xml
+++ b/src/samples/adaptive/pom.xml
@@ -15,7 +15,7 @@
 		<dependency>
 			<groupId>com.microsoft.sqlserver</groupId>
 			<artifactId>mssql-jdbc</artifactId>
-			<version>10.2.0.jre17</version>
+			<version>11.1.0.jre17</version>
 		</dependency>
 	</dependencies>
 	<profiles>
diff --git a/src/samples/alwaysencrypted/pom.xml b/src/samples/alwaysencrypted/pom.xml
index dfd05e0f..04f52c21 100644
--- a/src/samples/alwaysencrypted/pom.xml
+++ b/src/samples/alwaysencrypted/pom.xml
@@ -15,7 +15,7 @@
 		<dependency>
 			<groupId>com.microsoft.sqlserver</groupId>
 			<artifactId>mssql-jdbc</artifactId>
-			<version>10.2.0.jre17</version>
+			<version>11.1.0.jre17</version>
 		</dependency>
 	</dependencies>
 	<profiles>
diff --git a/src/samples/azureactivedirectoryauthentication/pom.xml b/src/samples/azureactivedirectoryauthentication/pom.xml
index 5321252a..1ab688a1 100644
--- a/src/samples/azureactivedirectoryauthentication/pom.xml
+++ b/src/samples/azureactivedirectoryauthentication/pom.xml
@@ -14,7 +14,7 @@
 		<dependency>
 			<groupId>com.microsoft.sqlserver</groupId>
 			<artifactId>mssql-jdbc</artifactId>
-			<version>10.2.0.jre17</version>
+			<version>11.1.0.jre17</version>
 		</dependency>
 	</dependencies>
 	<profiles>
diff --git a/src/samples/connections/pom.xml b/src/samples/connections/pom.xml
index 5dda73dd..6b8247c0 100644
--- a/src/samples/connections/pom.xml
+++ b/src/samples/connections/pom.xml
@@ -14,7 +14,7 @@
 		<dependency>
 			<groupId>com.microsoft.sqlserver</groupId>
 			<artifactId>mssql-jdbc</artifactId>
-			<version>10.2.0.jre17</version>
+			<version>11.1.0.jre17</version>
 		</dependency>
 	</dependencies>
 	<profiles>
diff --git a/src/samples/constrained/pom.xml b/src/samples/constrained/pom.xml
index 848a39c5..7b8c3660 100644
--- a/src/samples/constrained/pom.xml
+++ b/src/samples/constrained/pom.xml
@@ -16,7 +16,7 @@
         <dependency>
             <groupId>com.microsoft.sqlserver</groupId>
             <artifactId>mssql-jdbc</artifactId>
-            <version>10.2.0.jre17</version>
+            <version>11.1.0.jre17</version>
         </dependency>
     </dependencies>
     <profiles>
diff --git a/src/samples/dataclassification/pom.xml b/src/samples/dataclassification/pom.xml
index 0d03ce9c..97aa0e2c 100644
--- a/src/samples/dataclassification/pom.xml
+++ b/src/samples/dataclassification/pom.xml
@@ -16,7 +16,7 @@
 		<dependency>
 			<groupId>com.microsoft.sqlserver</groupId>
 			<artifactId>mssql-jdbc</artifactId>
-			<version>10.2.0.jre17</version>
+			<version>11.1.0.jre17</version>
 		</dependency>
 	</dependencies>
 	<profiles>
diff --git a/src/samples/datatypes/pom.xml b/src/samples/datatypes/pom.xml
index 8eefb95d..4da1c8ad 100644
--- a/src/samples/datatypes/pom.xml
+++ b/src/samples/datatypes/pom.xml
@@ -15,7 +15,7 @@
 		<dependency>
 			<groupId>com.microsoft.sqlserver</groupId>
 			<artifactId>mssql-jdbc</artifactId>
-			<version>10.2.0.jre17</version>
+			<version>11.1.0.jre17</version>
 		</dependency>
 	</dependencies>
 	<profiles>
diff --git a/src/samples/resultsets/pom.xml b/src/samples/resultsets/pom.xml
index 8130e24e..663c02d5 100644
--- a/src/samples/resultsets/pom.xml
+++ b/src/samples/resultsets/pom.xml
@@ -14,7 +14,7 @@
 		<dependency>
 			<groupId>com.microsoft.sqlserver</groupId>
 			<artifactId>mssql-jdbc</artifactId>
-			<version>10.2.0.jre17</version>
+			<version>11.1.0.jre17</version>
 		</dependency>
 	</dependencies>
 	<profiles>
diff --git a/src/samples/sparse/pom.xml b/src/samples/sparse/pom.xml
index 1c6e9cc4..c7ee06ea 100644
--- a/src/samples/sparse/pom.xml
+++ b/src/samples/sparse/pom.xml
@@ -14,7 +14,7 @@
 		<dependency>
 			<groupId>com.microsoft.sqlserver</groupId>
 			<artifactId>mssql-jdbc</artifactId>
-			<version>10.2.0.jre17</version>
+			<version>11.1.0.jre17</version>
 		</dependency>
 	</dependencies>
 	<profiles>


Test patch:
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/ActivityIDTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/ActivityIDTest.java
index e099da03..1e139d10 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/ActivityIDTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/ActivityIDTest.java
@@ -163,7 +163,6 @@ public class ActivityIDTest extends AbstractTest {
 
     @BeforeAll
     public static void testSetup() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString, "trustServerCertificate", "true");
         try {
             setConnection();
         } catch (SQLServerException e) {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/AESetup.java b/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/AESetup.java
index dbd27045..820fe5b0 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/AESetup.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/AESetup.java
@@ -192,7 +192,6 @@ public class AESetup extends AbstractTest {
 
     @BeforeAll
     public static void setupAETest() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString, "trustServerCertificate", "true");
         setConnection();
 
         readFromFile(Constants.JAVA_KEY_STORE_FILENAME, "Alias name");
@@ -220,16 +219,19 @@ public class AESetup extends AbstractTest {
 
             setAEConnectionString(serverName, url, protocol);
 
-            createCMK(AETestConnectionString, cmkJks, Constants.JAVA_KEY_STORE_NAME, javaKeyAliases, Constants.CMK_SIGNATURE);
+            createCMK(AETestConnectionString, cmkJks, Constants.JAVA_KEY_STORE_NAME, javaKeyAliases,
+                    Constants.CMK_SIGNATURE);
             createCEK(AETestConnectionString, cmkJks, cekJks, jksProvider);
 
             if (null != keyIDs && !keyIDs[0].isEmpty()) {
-                createCMK(AETestConnectionString, cmkAkv, Constants.AZURE_KEY_VAULT_NAME, keyIDs[0], Constants.CMK_SIGNATURE_AKV);
+                createCMK(AETestConnectionString, cmkAkv, Constants.AZURE_KEY_VAULT_NAME, keyIDs[0],
+                        Constants.CMK_SIGNATURE_AKV);
                 createCEK(AETestConnectionString, cmkAkv, cekAkv, akvProvider);
             }
 
             if (null != windowsKeyPath) {
-                createCMK(AETestConnectionString, cmkWin, Constants.WINDOWS_KEY_STORE_NAME, windowsKeyPath, Constants.CMK_SIGNATURE);
+                createCMK(AETestConnectionString, cmkWin, Constants.WINDOWS_KEY_STORE_NAME, windowsKeyPath,
+                        Constants.CMK_SIGNATURE);
                 createCEK(AETestConnectionString, cmkWin, cekWin, null);
             }
         }
@@ -1945,7 +1947,7 @@ public class AESetup extends AbstractTest {
     protected static void dropObject(String connString, String objectType, String objectName) {
         try (SQLServerConnection con = (SQLServerConnection) PrepUtil.getConnection(connString, AEInfo);
                 SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) {
-            switch(objectType) {
+            switch (objectType) {
                 case "TABLE":
                     TestUtils.dropTableIfExists(objectName, stmt);
                     break;
@@ -1958,7 +1960,7 @@ public class AESetup extends AbstractTest {
                 default:
                     break;
             }
-        } catch(Exception ex) {
+        } catch (Exception ex) {
             fail(ex.getMessage());
         }
     }
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/RegressionAlwaysEncryptedTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/RegressionAlwaysEncryptedTest.java
index c30dc0e5..87584eb7 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/RegressionAlwaysEncryptedTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/RegressionAlwaysEncryptedTest.java
@@ -44,7 +44,7 @@ public class RegressionAlwaysEncryptedTest extends AESetup {
     public void alwaysEncrypted1(String serverName, String url, String protocol) throws Exception {
         setAEConnectionString(serverName, url, protocol);
         try (Connection connection = PrepUtil.getConnection(
-                AETestConnectionString + ";trustservercertificate=true;columnEncryptionSetting=enabled;", AEInfo);
+                AETestConnectionString + ";columnEncryptionSetting=enabled;", AEInfo);
                 Statement stmt = connection.createStatement()) {
             dropTables(stmt);
 
@@ -74,7 +74,7 @@ public class RegressionAlwaysEncryptedTest extends AESetup {
     public void alwaysEncrypted2(String serverName, String url, String protocol) throws Exception {
         setAEConnectionString(serverName, url, protocol);
         try (Connection connection = PrepUtil.getConnection(
-                AETestConnectionString + ";trustservercertificate=true;columnEncryptionSetting=enabled;", AEInfo);
+                AETestConnectionString + ";columnEncryptionSetting=enabled;", AEInfo);
                 Statement stmt = connection.createStatement()) {
             dropTables(stmt);
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/EnclavePackageTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/EnclavePackageTest.java
index ffcb80b7..c9ee28dc 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/EnclavePackageTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/EnclavePackageTest.java
@@ -192,7 +192,6 @@ public class EnclavePackageTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/JDBC43Test.java b/src/test/java/com/microsoft/sqlserver/jdbc/JDBC43Test.java
index 487c1647..b6947d82 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/JDBC43Test.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/JDBC43Test.java
@@ -33,7 +33,6 @@ public class JDBC43Test extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/MaxResultBufferTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/MaxResultBufferTest.java
index 1694ecce..7e5b2d5f 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/MaxResultBufferTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/MaxResultBufferTest.java
@@ -69,7 +69,6 @@ public class MaxResultBufferTest extends AbstractTest {
         // reset logging to avoid severe logs triggered from tests
         LogManager.getLogManager().reset();
 
-        connectionString = TestUtils.addOrOverrideProperty(connectionString, "trustServerCertificate", "true");
         setConnection();
 
         String insertSQL = "INSERT INTO " + AbstractSQLGenerator.escapeIdentifier(TEST_TABLE_NAME) + " VALUES (?)";
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/NTLMConnectionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/NTLMConnectionTest.java
index b569ad79..18d4fc66 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/NTLMConnectionTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/NTLMConnectionTest.java
@@ -51,7 +51,6 @@ public class NTLMConnectionTest extends AbstractTest {
      */
     @BeforeAll
     public static void setUp() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         // reset logging to avoid servere logs due to negative testing
@@ -121,10 +120,11 @@ public class NTLMConnectionTest extends AbstractTest {
      */
     @Test
     public void testNTLMEncryptedConnection() throws SQLException {
-        try (Connection con = PrepUtil
-                .getConnection(connectionStringNTLM + ";encrypt=true;trustServerCertificate=true")) {
+        try (Connection con = PrepUtil.getConnection(
+                connectionStringNTLM + ";encrypt=" + encrypt + ";trustServerCertificate=" + trustServerCertificate)) {
             verifyNTLM(con);
         }
+
     }
 
     /**
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/RegisterKeyStoreProviderTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/RegisterKeyStoreProviderTest.java
index 1b22b03f..199f22a2 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/RegisterKeyStoreProviderTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/RegisterKeyStoreProviderTest.java
@@ -39,7 +39,6 @@ public class RegisterKeyStoreProviderTest extends AbstractTest {
 
     @BeforeAll
     public static void testSetup() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         singleKeyStoreProvider.put(dummyProviderName1, new DummyKeyStoreProvider());
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java
index e91984c0..0f206df8 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java
@@ -51,7 +51,6 @@ public class SQLServerConnectionTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
@@ -63,6 +62,7 @@ public class SQLServerConnectionTest extends AbstractTest {
         SQLServerDataSource ds = new SQLServerDataSource();
         String stringPropValue = "stringPropValue";
         boolean booleanPropValue = true;
+        String booleanStringValue = "true";
         int intPropValue = 1;
 
         ds.setInstanceName(stringPropValue);
@@ -159,8 +159,12 @@ public class SQLServerConnectionTest extends AbstractTest {
         ds.setTrustStorePassword(stringPropValue);
         assertEquals(stringPropValue, ds.getTrustStorePassword(), TestResource.getResource("R_valuesAreDifferent"));
 
+        ds.setEncrypt(booleanStringValue);
+        assertEquals(booleanStringValue, ds.getEncrypt(), TestResource.getResource("R_valuesAreDifferent"));
+
         ds.setEncrypt(booleanPropValue);
-        assertEquals(booleanPropValue, ds.getEncrypt(), TestResource.getResource("R_valuesAreDifferent"));
+        assertEquals(Boolean.toString(booleanPropValue), ds.getEncrypt(),
+                TestResource.getResource("R_valuesAreDifferent"));
 
         ds.setPrepareMethod(stringPropValue);
         assertEquals(stringPropValue, ds.getPrepareMethod(), TestResource.getResource("R_valuesAreDifferent"));
@@ -281,8 +285,12 @@ public class SQLServerConnectionTest extends AbstractTest {
         SQLServerDataSource ds = new SQLServerDataSource();
         ds.setApplicationName("User");
         ds.setURL(connectionString);
-        ds.setEncrypt(true);
-        ds.setTrustServerCertificate(true);
+        if (encrypt == null) {
+            ds.setEncrypt(Constants.TRUE);
+        }
+        if (trustServerCertificate == null) {
+            ds.setTrustServerCertificate(true);
+        }
         ds.setPacketSize(8192);
         try (Connection con = ds.getConnection()) {}
     }
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/TestUtils.java b/src/test/java/com/microsoft/sqlserver/jdbc/TestUtils.java
index 0787f6fe..83e02b52 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/TestUtils.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/TestUtils.java
@@ -75,18 +75,20 @@ public final class TestUtils {
     static final int ENGINE_EDITION_FOR_SQL_AZURE_MI = 8;
 
     private TestUtils() {}
-    
+
     /**
      * Checks if the connection session recovery object has negotiated reflection.
+     * 
      * @param con
      * @return
      */
     public static boolean isConnectionRecoveryNegotiated(Connection con) {
         return ((SQLServerConnection) con).getSessionRecovery().isConnectionRecoveryNegotiated();
     }
-    
+
     /**
      * Checks if connection is dead.
+     * 
      * @param con
      * @return
      * @throws SQLServerException
@@ -868,7 +870,7 @@ public final class TestUtils {
      * @return The updated connection string
      */
     public static String removeProperty(String connectionString, String property) {
-        int start = connectionString.indexOf(property);
+        int start = connectionString.toLowerCase().indexOf(property.toLowerCase());
         int end = connectionString.indexOf(";", start);
         String propertyStr = connectionString.substring(start, -1 != end ? end + 1 : connectionString.length());
         return connectionString.replace(propertyStr, "");
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/TimeoutTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/TimeoutTest.java
index d1bbf863..d232859f 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/TimeoutTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/TimeoutTest.java
@@ -38,7 +38,6 @@ public class TimeoutTest extends AbstractTest {
 
     @BeforeAll
     public static void beforeAll() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         if (connection != null) {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyAllTypesTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyAllTypesTest.java
index ceedbef0..11d88d61 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyAllTypesTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyAllTypesTest.java
@@ -34,7 +34,6 @@ public class BulkCopyAllTypesTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyCSVTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyCSVTest.java
index 2b927c67..48e28b71 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyCSVTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyCSVTest.java
@@ -77,7 +77,6 @@ public class BulkCopyCSVTest extends AbstractTest {
      */
     @BeforeAll
     public static void setUpConnection() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         con = new DBConnection(connectionString);
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyISQLServerBulkRecordTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyISQLServerBulkRecordTest.java
index 25c95b4c..cc011510 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyISQLServerBulkRecordTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyISQLServerBulkRecordTest.java
@@ -54,7 +54,6 @@ public class BulkCopyISQLServerBulkRecordTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyResultSetCursorTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyResultSetCursorTest.java
index be0e209a..b38d11cb 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyResultSetCursorTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyResultSetCursorTest.java
@@ -53,7 +53,6 @@ public class BulkCopyResultSetCursorTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyRowSetTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyRowSetTest.java
index be24f8f1..c3e55cb8 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyRowSetTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyRowSetTest.java
@@ -104,7 +104,6 @@ public class BulkCopyRowSetTest extends AbstractTest {
 
     @BeforeAll
     public static void testSetup() throws TestAbortedException, Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         try (Statement stmt = connection.createStatement()) {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopySendTemporalDataTypesAsStringTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopySendTemporalDataTypesAsStringTest.java
index 5f096207..d8a837ed 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopySendTemporalDataTypesAsStringTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopySendTemporalDataTypesAsStringTest.java
@@ -256,7 +256,6 @@ public class BulkCopySendTemporalDataTypesAsStringTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTest() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
         filePath = TestUtils.getCurrentClassPath();
     }
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyTestSetUp.java b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyTestSetUp.java
index b6141447..9f82a1ee 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyTestSetUp.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyTestSetUp.java
@@ -34,7 +34,6 @@ public class BulkCopyTestSetUp extends AbstractTest {
      */
     @BeforeAll
     public static void setUpSourceTable() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         try (DBConnection con = new DBConnection(connectionString); DBStatement stmt = con.createStatement();
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/ISQLServerBulkRecordIssuesTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/ISQLServerBulkRecordIssuesTest.java
index eea35222..22dab100 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/ISQLServerBulkRecordIssuesTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/ISQLServerBulkRecordIssuesTest.java
@@ -52,7 +52,6 @@ public class ISQLServerBulkRecordIssuesTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/bvt/BvtTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/bvt/BvtTest.java
index 2e6816bf..afa907cb 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/bvt/BvtTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/bvt/BvtTest.java
@@ -440,7 +440,6 @@ public class BvtTest extends AbstractTest {
 
     @BeforeAll
     public static void init() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         try (DBConnection conn = new DBConnection(connectionString); DBStatement stmt = conn.createStatement()) {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableMixedTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableMixedTest.java
index d8cbe226..e6aaa14f 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableMixedTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableMixedTest.java
@@ -31,7 +31,6 @@ public class CallableMixedTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableStatementTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableStatementTest.java
index ea02ae37..6f4610a2 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableStatementTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableStatementTest.java
@@ -58,7 +58,6 @@ public class CallableStatementTest extends AbstractTest {
      */
     @BeforeAll
     public static void setupTest() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         try (Statement stmt = connection.createStatement()) {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/clientcertauth/ClientCertificateAuthenticationTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/clientcertauth/ClientCertificateAuthenticationTest.java
index af34de30..e8fb57bb 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/clientcertauth/ClientCertificateAuthenticationTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/clientcertauth/ClientCertificateAuthenticationTest.java
@@ -26,8 +26,8 @@ import com.microsoft.sqlserver.testframework.Constants;
 
 
 /**
- * Tests client certificate authentication feature
- * The feature is only supported against SQL Server Linux CU2 or higher.
+ * Tests client certificate authentication feature. The feature is only supported against SQL Server Linux CU2 or
+ * higher.
  * 
  */
 @RunWith(JUnitPlatform.class)
@@ -52,8 +52,8 @@ public class ClientCertificateAuthenticationTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        //Turn off default encrypt true
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"encrypt", "false");
+        // Turn off default encrypt true
+        connectionString = TestUtils.addOrOverrideProperty(connectionString, "encrypt", "false");
         setConnection();
     }
 
@@ -209,10 +209,10 @@ public class ClientCertificateAuthenticationTest extends AbstractTest {
     @Test
     public void testEncryptTrusted() throws Exception {
         String conStr = connectionString + ";clientCertificate=" + clientCertificate + PEM_SUFFIX + "clientKey="
-                + clientKey + PKCS8_KEY_SUFFIX + "encrypt=true;trustServerCertificate=true;";
-        try (Connection conn = DriverManager.getConnection(conStr); Statement stmt = conn.createStatement()) {
-            ResultSet rs = stmt
-                    .executeQuery("SELECT encrypt_option FROM sys.dm_exec_connections WHERE session_id = @@SPID");
+                + clientKey + PKCS8_KEY_SUFFIX;
+        try (Connection conn = DriverManager.getConnection(conStr); Statement stmt = conn.createStatement();
+                ResultSet rs = stmt
+                        .executeQuery("SELECT encrypt_option FROM sys.dm_exec_connections WHERE session_id = @@SPID")) {
             rs.next();
             assertTrue(rs.getBoolean(1));
         }
@@ -226,11 +226,10 @@ public class ClientCertificateAuthenticationTest extends AbstractTest {
     @Test
     public void testEncryptUntrusted() throws Exception {
         String conStr = connectionString + ";clientCertificate=" + clientCertificate + PEM_SUFFIX + "clientKey="
-                + clientKey + PKCS8_KEY_SUFFIX + "encrypt=true;trustServerCertificate=false;trustStore="
-                + trustStorePath;
-        try (Connection conn = DriverManager.getConnection(conStr); Statement stmt = conn.createStatement()) {
-            ResultSet rs = stmt
-                    .executeQuery("SELECT encrypt_option FROM sys.dm_exec_connections WHERE session_id = @@SPID");
+                + clientKey + PKCS8_KEY_SUFFIX;
+        try (Connection conn = DriverManager.getConnection(conStr); Statement stmt = conn.createStatement();
+                ResultSet rs = stmt
+                        .executeQuery("SELECT encrypt_option FROM sys.dm_exec_connections WHERE session_id = @@SPID")) {
             rs.next();
             assertTrue(rs.getBoolean(1));
         }
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/ClientProcessIdTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/ClientProcessIdTest.java
index cced33bc..8d672458 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/ClientProcessIdTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/ClientProcessIdTest.java
@@ -33,7 +33,6 @@ public class ClientProcessIdTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionTest.java
index 41d3d4fd..40110c6a 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionTest.java
@@ -24,7 +24,6 @@ public class ConnectionTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionWrapper43Test.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionWrapper43Test.java
index 8923c75b..3970c7bb 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionWrapper43Test.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionWrapper43Test.java
@@ -55,7 +55,6 @@ public class ConnectionWrapper43Test extends AbstractTest {
 
     @BeforeAll
     public static void setupConnection() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         connection = getConnection();
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/DBMetadataTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/DBMetadataTest.java
index 27a38a08..dc18afca 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/DBMetadataTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/DBMetadataTest.java
@@ -32,7 +32,6 @@ public class DBMetadataTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/DriverVersionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/DriverVersionTest.java
index c319ad1d..e2349f86 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/DriverVersionTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/DriverVersionTest.java
@@ -37,7 +37,6 @@ public class DriverVersionTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/NativeMSSQLDataSourceTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/NativeMSSQLDataSourceTest.java
index 4059faf1..e8c508f4 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/NativeMSSQLDataSourceTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/NativeMSSQLDataSourceTest.java
@@ -33,7 +33,6 @@ public class NativeMSSQLDataSourceTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
@@ -75,7 +74,9 @@ public class NativeMSSQLDataSourceTest extends AbstractTest {
         System.setProperty("java.net.preferIPv6Addresses", Boolean.TRUE.toString());
         ds.setURL(connectionString);
         ds.setTrustStorePassword("wrong_password");
-        try (Connection conn = ds.getConnection()) {}
+        try (Connection conn = ds.getConnection()) {} catch (SQLException e) {
+            assert (e.getMessage().contains(TestResource.getResource("R_keystorePassword")));
+        }
         ds = testSerial(ds);
         try (Connection conn = ds.getConnection()) {} catch (SQLException e) {
             assertEquals(TestResource.getResource("R_trustStorePasswordNotSet"), e.getMessage());
@@ -117,8 +118,7 @@ public class NativeMSSQLDataSourceTest extends AbstractTest {
     @Test
     public void testDSReference() {
         SQLServerDataSource ds = new SQLServerDataSource();
-        assertTrue(ds.getReference().getClassName()
-                .equals("com.microsoft.sqlserver.jdbc.SQLServerDataSource"));
+        assertTrue(ds.getReference().getClassName().equals("com.microsoft.sqlserver.jdbc.SQLServerDataSource"));
     }
 
     private SQLServerDataSource testSerial(SQLServerDataSource ds) throws IOException, ClassNotFoundException {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/PoolingTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/PoolingTest.java
index c0518047..a23d6151 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/PoolingTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/PoolingTest.java
@@ -49,7 +49,6 @@ public class PoolingTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/ReplicationTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/ReplicationTest.java
index a8ffdfef..afbf560a 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/ReplicationTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/ReplicationTest.java
@@ -34,7 +34,6 @@ public class ReplicationTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/RequestBoundaryMethodsTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/RequestBoundaryMethodsTest.java
index dab2329c..ee768ccf 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/RequestBoundaryMethodsTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/RequestBoundaryMethodsTest.java
@@ -49,7 +49,6 @@ public class RequestBoundaryMethodsTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/SSLProtocolTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/SSLProtocolTest.java
index bc03c2e2..3c66ffac 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/SSLProtocolTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/SSLProtocolTest.java
@@ -33,7 +33,6 @@ public class SSLProtocolTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/TimeoutTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/TimeoutTest.java
index ba084cb8..7838039e 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/TimeoutTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/TimeoutTest.java
@@ -43,7 +43,6 @@ public class TimeoutTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/WarningTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/WarningTest.java
index e96d63da..b2b62af2 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/WarningTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/WarningTest.java
@@ -30,7 +30,6 @@ public class WarningTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/XADataSourceTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/XADataSourceTest.java
index 7b867f23..803aa2ee 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/XADataSourceTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/XADataSourceTest.java
@@ -5,6 +5,8 @@
 
 package com.microsoft.sqlserver.jdbc.connection;
 
+import java.sql.Connection;
+
 import javax.sql.XAConnection;
 
 import com.microsoft.sqlserver.jdbc.TestUtils;
@@ -14,6 +16,7 @@ import org.junit.jupiter.api.Test;
 import org.junit.platform.runner.JUnitPlatform;
 import org.junit.runner.RunWith;
 
+import com.microsoft.sqlserver.jdbc.SQLServerDataSource;
 import com.microsoft.sqlserver.jdbc.SQLServerXADataSource;
 import com.microsoft.sqlserver.testframework.AbstractTest;
 import com.microsoft.sqlserver.testframework.Constants;
@@ -22,11 +25,10 @@ import com.microsoft.sqlserver.testframework.Constants;
 @RunWith(JUnitPlatform.class)
 @Tag(Constants.reqExternalSetup)
 public class XADataSourceTest extends AbstractTest {
-    private static String connectionUrlSSL = connectionString + ";encrypt=true;trustServerCertificate=false;";
+    private static String connectionUrlSSL = connectionString;
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/databasemetadata/DatabaseMetaDataForeignKeyTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/databasemetadata/DatabaseMetaDataForeignKeyTest.java
index 3ef964fe..d394a891 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/databasemetadata/DatabaseMetaDataForeignKeyTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/databasemetadata/DatabaseMetaDataForeignKeyTest.java
@@ -54,7 +54,6 @@ public class DatabaseMetaDataForeignKeyTest extends AbstractTest {
 
     @BeforeAll
     public static void setupVariation() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         cleanup();
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/databasemetadata/DatabaseMetaDataTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/databasemetadata/DatabaseMetaDataTest.java
index 569da9d1..8041a35b 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/databasemetadata/DatabaseMetaDataTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/databasemetadata/DatabaseMetaDataTest.java
@@ -797,7 +797,6 @@ public class DatabaseMetaDataTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTable() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         try (Statement stmt = connection.createStatement()) {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/BigIntegerTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/BigIntegerTest.java
index 0622be0e..d46d9388 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/BigIntegerTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/BigIntegerTest.java
@@ -40,7 +40,6 @@ public class BigIntegerTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/BulkCopyWithSqlVariantTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/BulkCopyWithSqlVariantTest.java
index 2490d92a..dde706a3 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/BulkCopyWithSqlVariantTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/BulkCopyWithSqlVariantTest.java
@@ -42,7 +42,6 @@ public class BulkCopyWithSqlVariantTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/DataTypesTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/DataTypesTest.java
index a2cd3557..4ddff40d 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/DataTypesTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/DataTypesTest.java
@@ -98,7 +98,6 @@ public class DataTypesTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/DateAndTimeTypeTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/DateAndTimeTypeTest.java
index 533a04c2..b83a47d5 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/DateAndTimeTypeTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/DateAndTimeTypeTest.java
@@ -196,7 +196,6 @@ public class DateAndTimeTypeTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/SQLServerSpatialDatatypeTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/SQLServerSpatialDatatypeTest.java
index 87e79e4a..b4c7078a 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/SQLServerSpatialDatatypeTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/SQLServerSpatialDatatypeTest.java
@@ -2202,7 +2202,6 @@ public class SQLServerSpatialDatatypeTest extends AbstractTest {
      */
     @BeforeAll
     public static void setupHere() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         geomTableName = RandomUtil.getIdentifier("geometryTestTable");
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/SQLVariantResultSetTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/SQLVariantResultSetTest.java
index 214f67e2..e404ded6 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/SQLVariantResultSetTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/SQLVariantResultSetTest.java
@@ -1111,7 +1111,6 @@ public class SQLVariantResultSetTest extends AbstractTest {
      */
     @BeforeAll
     public static void setupHere() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         tableName = RandomUtil.getIdentifier("sqlVariantTestSrcTable");
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/SparseTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/SparseTest.java
index 2a527242..a2ee5433 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/SparseTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/SparseTest.java
@@ -26,7 +26,6 @@ public class SparseTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/TVPWithSqlVariantTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/TVPWithSqlVariantTest.java
index dc2c4f2c..1dd65232 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/TVPWithSqlVariantTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/datatypes/TVPWithSqlVariantTest.java
@@ -469,7 +469,6 @@ public class TVPWithSqlVariantTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/exception/ErrorStateTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/exception/ErrorStateTest.java
index 9e2de1dd..58ce056c 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/exception/ErrorStateTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/exception/ErrorStateTest.java
@@ -18,7 +18,6 @@ public class ErrorStateTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/exception/ExceptionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/exception/ExceptionTest.java
index 11dff51c..2d61efbd 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/exception/ExceptionTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/exception/ExceptionTest.java
@@ -39,7 +39,6 @@ public class ExceptionTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ConcurrentLoginTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ConcurrentLoginTest.java
index 6b850997..72dae99f 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ConcurrentLoginTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ConcurrentLoginTest.java
@@ -36,7 +36,6 @@ public class ConcurrentLoginTest extends FedauthCommon {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ConnectionSuspensionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ConnectionSuspensionTest.java
index c23d6f81..9e42e19b 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ConnectionSuspensionTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ConnectionSuspensionTest.java
@@ -38,7 +38,6 @@ public class ConnectionSuspensionTest extends FedauthCommon {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ErrorMessageTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ErrorMessageTest.java
index 0630c05c..933e7559 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ErrorMessageTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ErrorMessageTest.java
@@ -33,7 +33,6 @@ public class ErrorMessageTest extends FedauthCommon {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/FedauthTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/FedauthTest.java
index 6a6d16ef..1324ff8a 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/FedauthTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/FedauthTest.java
@@ -42,7 +42,7 @@ public class FedauthTest extends FedauthCommon {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
+        connectionString = TestUtils.addOrOverrideProperty(connectionString, "trustServerCertificate", "true");
         setConnection();
     }
 
@@ -168,56 +168,56 @@ public class FedauthTest extends FedauthCommon {
 
     @Test
     public void testNotValidNotSpecified() throws SQLException {
-        testNotValid(SqlAuthentication.NotSpecified.toString(), false, false);
-        testNotValid(SqlAuthentication.NotSpecified.toString(), false, true);
-        testNotValid(SqlAuthentication.NotSpecified.toString(), true, true);
+        testNotValid(SqlAuthentication.NotSpecified.toString(), Constants.FALSE, false);
+        testNotValid(SqlAuthentication.NotSpecified.toString(), Constants.FALSE, true);
+        testNotValid(SqlAuthentication.NotSpecified.toString(), Constants.TRUE, true);
     }
 
     @Test
     public void testNotValidSqlPassword() throws SQLException {
-        testNotValid(SqlAuthentication.SqlPassword.toString(), false, true);
-        testNotValid(SqlAuthentication.SqlPassword.toString(), true, true);
+        testNotValid(SqlAuthentication.SqlPassword.toString(), Constants.FALSE, true);
+        testNotValid(SqlAuthentication.SqlPassword.toString(), Constants.TRUE, true);
     }
 
     @Test
     public void testNotValidActiveDirectoryIntegrated() throws SQLException {
         org.junit.Assume.assumeTrue(enableADIntegrated);
 
-        testNotValid(SqlAuthentication.ActiveDirectoryIntegrated.toString(), false, true);
-        testNotValid(SqlAuthentication.ActiveDirectoryIntegrated.toString(), true, true);
+        testNotValid(SqlAuthentication.ActiveDirectoryIntegrated.toString(), Constants.FALSE, true);
+        testNotValid(SqlAuthentication.ActiveDirectoryIntegrated.toString(), Constants.TRUE, true);
     }
 
     @Test
     public void testNotValidActiveDirectoryPassword() throws SQLException {
-        testNotValid(SqlAuthentication.ActiveDirectoryPassword.toString(), false, true);
-        testNotValid(SqlAuthentication.ActiveDirectoryPassword.toString(), true, true);
+        testNotValid(SqlAuthentication.ActiveDirectoryPassword.toString(), Constants.FALSE, true);
+        testNotValid(SqlAuthentication.ActiveDirectoryPassword.toString(), Constants.TRUE, true);
     }
 
     @Test
     public void testValidNotSpecified() throws SQLException {
-        testValid(SqlAuthentication.NotSpecified.toString(), false, false);
-        testValid(SqlAuthentication.NotSpecified.toString(), false, true);
-        testValid(SqlAuthentication.NotSpecified.toString(), true, true);
+        testValid(SqlAuthentication.NotSpecified.toString(), Constants.FALSE, false);
+        testValid(SqlAuthentication.NotSpecified.toString(), Constants.FALSE, true);
+        testValid(SqlAuthentication.NotSpecified.toString(), Constants.TRUE, true);
     }
 
     @Test
     public void testValidSqlPassword() throws SQLException {
-        testValid(SqlAuthentication.SqlPassword.toString(), false, true);
-        testValid(SqlAuthentication.SqlPassword.toString(), true, true);
+        testValid(SqlAuthentication.SqlPassword.toString(), Constants.FALSE, true);
+        testValid(SqlAuthentication.SqlPassword.toString(), Constants.TRUE, true);
     }
 
     @Test
     public void testValidActiveDirectoryIntegrated() throws SQLException {
         org.junit.Assume.assumeTrue(enableADIntegrated);
 
-        testValid(SqlAuthentication.ActiveDirectoryIntegrated.toString(), false, true);
-        testValid(SqlAuthentication.ActiveDirectoryIntegrated.toString(), true, true);
+        testValid(SqlAuthentication.ActiveDirectoryIntegrated.toString(), Constants.FALSE, true);
+        testValid(SqlAuthentication.ActiveDirectoryIntegrated.toString(), Constants.TRUE, true);
     }
 
     @Test
     public void testValidActiveDirectoryPassword() throws SQLException {
-        testValid(SqlAuthentication.ActiveDirectoryPassword.toString(), false, true);
-        testValid(SqlAuthentication.ActiveDirectoryPassword.toString(), true, true);
+        testValid(SqlAuthentication.ActiveDirectoryPassword.toString(), Constants.FALSE, true);
+        testValid(SqlAuthentication.ActiveDirectoryPassword.toString(), Constants.TRUE, true);
     }
 
     @Test
@@ -360,7 +360,7 @@ public class FedauthTest extends FedauthCommon {
         }
     }
 
-    private void testValid(String authentication, boolean encrypt, boolean trustServerCertificate) throws SQLException {
+    private void testValid(String authentication, String encrypt, boolean trustServerCertificate) throws SQLException {
         try {
             SQLServerDataSource ds = new SQLServerDataSource();
             if (!authentication.equalsIgnoreCase(SqlAuthentication.ActiveDirectoryIntegrated.toString())) {
@@ -391,7 +391,7 @@ public class FedauthTest extends FedauthCommon {
         }
     }
 
-    private void testNotValid(String authentication, boolean encrypt,
+    private void testNotValid(String authentication, String encrypt,
             boolean trustServerCertificate) throws SQLException {
         try {
             SQLServerDataSource ds = new SQLServerDataSource();
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/FedauthWithAE.java b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/FedauthWithAE.java
index a34d4ee3..bfd09d3b 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/FedauthWithAE.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/FedauthWithAE.java
@@ -52,7 +52,6 @@ public class FedauthWithAE extends FedauthCommon {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString, "trustServerCertificate", "true");
         setConnection();
 
         ds.setServerName(azureServer);
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/PooledConnectionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/PooledConnectionTest.java
index 884b6c27..244fc059 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/PooledConnectionTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/PooledConnectionTest.java
@@ -46,7 +46,6 @@ public class PooledConnectionTest extends FedauthCommon {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fips/FipsTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fips/FipsTest.java
index a486e3c2..5a032c59 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fips/FipsTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fips/FipsTest.java
@@ -33,15 +33,14 @@ public class FipsTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        //Turn off default encrypt true
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"encrypt", "false");
         setConnection();
     }
 
     /**
      * Test after setting TrustServerCertificate as true.
      * 
-     * @throws Exception when an error occurs
+     * @throws Exception
+     *         when an error occurs
      */
     @Test
     public void fipsTrustServerCertificateTest() throws Exception {
@@ -58,7 +57,8 @@ public class FipsTest extends AbstractTest {
     /**
      * Test after passing encrypt as false.
      * 
-     * @throws Exception when an error occurs
+     * @throws Exception
+     *         when an error occurs
      */
     @Test
     public void fipsEncryptTest() throws Exception {
@@ -75,7 +75,8 @@ public class FipsTest extends AbstractTest {
     /**
      * Test after removing fips, encrypt & trustStore it should work appropriately.
      * 
-     * @throws Exception when an error occurs
+     * @throws Exception
+     *         when an error occurs
      */
     @Test
     public void fipsPropertyTest() throws Exception {
@@ -95,14 +96,15 @@ public class FipsTest extends AbstractTest {
     /**
      * Tests after removing all FIPS related properties.
      * 
-     * @throws Exception when an error occurs
+     * @throws Exception
+     *         when an error occurs
      */
     @Test
     public void fipsDataSourcePropertyTest() throws Exception {
         SQLServerDataSource ds = new SQLServerDataSource();
         setDataSourceProperties(ds);
         ds.setFIPS(false);
-        ds.setEncrypt(false);
+        ds.setEncrypt(Constants.FALSE);
         ds.setTrustStoreType(Constants.JKS);
         try (Connection con = ds.getConnection()) {
             Assertions.assertTrue(!StringUtils.isEmpty(con.getSchema()));
@@ -118,7 +120,7 @@ public class FipsTest extends AbstractTest {
     public void fipsDatSourceEncrypt() {
         SQLServerDataSource ds = new SQLServerDataSource();
         setDataSourceProperties(ds);
-        ds.setEncrypt(false);
+        ds.setEncrypt(Constants.FALSE);
 
         try (Connection con = ds.getConnection()) {
             Assertions.fail(TestResource.getResource("R_expectedExceptionNotThrown"));
@@ -131,7 +133,8 @@ public class FipsTest extends AbstractTest {
     /**
      * Test after setting TrustServerCertificate as true.
      * 
-     * @throws Exception when an error occurs
+     * @throws Exception
+     *         when an error occurs
      */
     @Test
     public void fipsDataSourceTrustServerCertificateTest() throws Exception {
@@ -157,7 +160,7 @@ public class FipsTest extends AbstractTest {
 
         // Set all properties for FIPS
         ds.setFIPS(true);
-        ds.setEncrypt(true);
+        ds.setEncrypt(Constants.TRUE);
         ds.setTrustServerCertificate(false);
         ds.setIntegratedSecurity(false);
         ds.setTrustStoreType(Constants.PKCS12);
@@ -174,11 +177,12 @@ public class FipsTest extends AbstractTest {
         connectionProps.setProperty(Constants.ENCRYPT, Boolean.TRUE.toString());
         connectionProps.setProperty(Constants.INTEGRATED_SECURITY, Boolean.FALSE.toString());
 
-        // In case of false we need to pass keystore etc. which is not passing by default.
         connectionProps.setProperty(Constants.TRUST_SERVER_CERTIFICATE, Boolean.FALSE.toString());
 
-        // For New Code
         connectionProps.setProperty(Constants.TRUST_STORE_TYPE, Constants.PKCS12);
+        connectionProps.setProperty(Constants.TRUST_STORE, trustStore);
+        connectionProps.setProperty(Constants.TRUST_STORE_SECRET_PROPERTY, trustStorePassword);
+
         connectionProps.setProperty(Constants.FIPS, Boolean.TRUE.toString());
 
         return connectionProps;
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/APITest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/APITest.java
index 050c59a5..29f5db8d 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/APITest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/APITest.java
@@ -28,7 +28,6 @@ public class APITest extends AbstractTest {
 
     @BeforeAll
     private static void setupTest() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         try (Statement s = connection.createStatement()) {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/DeleteTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/DeleteTest.java
index f59e01dd..b95f0105 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/DeleteTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/DeleteTest.java
@@ -15,7 +15,6 @@ public class DeleteTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/InsertTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/InsertTest.java
index b104729d..721c5ebe 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/InsertTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/InsertTest.java
@@ -15,7 +15,6 @@ public class InsertTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/LexerTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/LexerTest.java
index 8653d1f9..7e1ceaaa 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/LexerTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/LexerTest.java
@@ -15,7 +15,6 @@ public class LexerTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/ParameterMetaDataTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/ParameterMetaDataTest.java
index 0d1b49a4..f9aaf72b 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/ParameterMetaDataTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/ParameterMetaDataTest.java
@@ -31,7 +31,6 @@ public class ParameterMetaDataTest extends AbstractTest {
 
     @BeforeEach
     public void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         try (Connection c = getConnection(); Statement s = c.createStatement()) {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/SelectTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/SelectTest.java
index 1e195de2..42d57ab8 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/SelectTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/SelectTest.java
@@ -15,7 +15,6 @@ public class SelectTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/UpdateTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/UpdateTest.java
index ed7dc975..c3cc932e 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/UpdateTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/fmtOnly/UpdateTest.java
@@ -15,7 +15,6 @@ public class UpdateTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/osgi/DataFactoryTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/osgi/DataFactoryTest.java
index 047e180c..bfa8c3fe 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/osgi/DataFactoryTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/osgi/DataFactoryTest.java
@@ -40,7 +40,6 @@ public class DataFactoryTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/parametermetadata/ParameterMetaDataTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/parametermetadata/ParameterMetaDataTest.java
index 9cd25a6f..61b9936a 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/parametermetadata/ParameterMetaDataTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/parametermetadata/ParameterMetaDataTest.java
@@ -32,7 +32,6 @@ public class ParameterMetaDataTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/parametermetadata/ParameterMetaDataWhiteSpaceTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/parametermetadata/ParameterMetaDataWhiteSpaceTest.java
index 1edc67cc..31ab3d35 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/parametermetadata/ParameterMetaDataWhiteSpaceTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/parametermetadata/ParameterMetaDataWhiteSpaceTest.java
@@ -33,7 +33,6 @@ public class ParameterMetaDataWhiteSpaceTest extends AbstractTest {
 
     @BeforeAll
     public static void BeforeTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         createCharTable();
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithBulkCopyTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithBulkCopyTest.java
index 766ddb8a..efd9180f 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithBulkCopyTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithBulkCopyTest.java
@@ -697,7 +697,6 @@ public class BatchExecutionWithBulkCopyTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithNullTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithNullTest.java
index 05b7e54d..672708de 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithNullTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithNullTest.java
@@ -184,7 +184,6 @@ public class BatchExecutionWithNullTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/RegressionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/RegressionTest.java
index ef4ab2f5..cc987984 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/RegressionTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/RegressionTest.java
@@ -51,7 +51,6 @@ public class RegressionTest extends AbstractTest {
      */
     @BeforeAll
     public static void setupTest() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         try (Statement stmt = connection.createStatement()) {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/SetObjectTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/SetObjectTest.java
index 05f95bbc..212829ef 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/SetObjectTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/SetObjectTest.java
@@ -40,7 +40,6 @@ public class SetObjectTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/BasicConnectionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/BasicConnectionTest.java
index 3d326c78..9f1a41bd 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/BasicConnectionTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/BasicConnectionTest.java
@@ -35,8 +35,6 @@ public class BasicConnectionTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        // Turn off default encrypt true
-        connectionString = TestUtils.addOrOverrideProperty(connectionString, "encrypt", "false");
         setConnection();
     }
 
@@ -59,7 +57,7 @@ public class BasicConnectionTest extends AbstractTest {
 
     @Test
     public void testBasicEncryptedConnection() throws SQLException {
-        basicReconnect(connectionString + ";encrypt=true;trustServerCertificate=true;");
+        basicReconnect(connectionString);
     }
 
     @Test
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/PropertyTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/PropertyTest.java
index f0ea6b7d..7dc843ec 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/PropertyTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/PropertyTest.java
@@ -29,7 +29,6 @@ public class PropertyTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/ReflectiveTests.java b/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/ReflectiveTests.java
index 88a72e73..e25579d0 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/ReflectiveTests.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/ReflectiveTests.java
@@ -35,7 +35,6 @@ public class ReflectiveTests extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/ResultSetsWithResiliencyTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/ResultSetsWithResiliencyTest.java
index fb8aa6e3..a326234b 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/ResultSetsWithResiliencyTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/resiliency/ResultSetsWithResiliencyTest.java
@@ -35,7 +35,6 @@ public class ResultSetsWithResiliencyTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         try (Connection c = DriverManager.getConnection(connectionString); Statement s = c.createStatement();) {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/resultset/DataClassificationTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/resultset/DataClassificationTest.java
index ad6c7063..620772a5 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/resultset/DataClassificationTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/resultset/DataClassificationTest.java
@@ -44,7 +44,6 @@ public class DataClassificationTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java
index d94078eb..c176fb2c 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java
@@ -52,7 +52,6 @@ public class ResultSetTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/socketfactory/CustomSocketFactoryTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/socketfactory/CustomSocketFactoryTest.java
index 98861436..543d8e91 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/socketfactory/CustomSocketFactoryTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/socketfactory/CustomSocketFactoryTest.java
@@ -14,8 +14,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import javax.net.SocketFactory;
-
-import com.microsoft.sqlserver.jdbc.TestUtils;
 import org.junit.Assert;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
@@ -33,7 +31,6 @@ public class CustomSocketFactoryTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/ssl/trustmanager/CustomTrustManagerTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/ssl/trustmanager/CustomTrustManagerTest.java
index f3c70eb7..54c81784 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/ssl/trustmanager/CustomTrustManagerTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/ssl/trustmanager/CustomTrustManagerTest.java
@@ -5,8 +5,8 @@
 
 package com.microsoft.sqlserver.jdbc.ssl.trustmanager;
 
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.sql.Connection;
 import java.sql.SQLException;
@@ -16,7 +16,9 @@ import org.junit.platform.runner.JUnitPlatform;
 import org.junit.runner.RunWith;
 
 import com.microsoft.sqlserver.jdbc.TestResource;
+import com.microsoft.sqlserver.jdbc.TestUtils;
 import com.microsoft.sqlserver.testframework.AbstractTest;
+import com.microsoft.sqlserver.testframework.Constants;
 import com.microsoft.sqlserver.testframework.PrepUtil;
 
 
@@ -30,8 +32,7 @@ public class CustomTrustManagerTest extends AbstractTest {
      */
     @Test
     public void testWithPermissiveX509TrustManager() throws Exception {
-        String url = connectionString + ";trustManagerClass=" + PermissiveTrustManager.class.getName()
-                + ";encrypt=true;";
+        String url = connectionString + ";trustManagerClass=" + PermissiveTrustManager.class.getName();
         try (Connection con = PrepUtil.getConnection(url)) {
             assertTrue(con != null);
         }
@@ -45,7 +46,7 @@ public class CustomTrustManagerTest extends AbstractTest {
     @Test
     public void testWithTrustManagerConstructorArg() throws Exception {
         String url = connectionString + ";trustManagerClass=" + TrustManagerWithConstructorArg.class.getName()
-                + ";trustManagerConstructorArg=dummyString;" + ";encrypt=true;";
+                + ";trustManagerConstructorArg=dummyString;";
         try (Connection con = PrepUtil.getConnection(url)) {
             assertTrue(con != null);
         }
@@ -58,12 +59,14 @@ public class CustomTrustManagerTest extends AbstractTest {
      */
     @Test
     public void testWithInvalidTrustManager() throws Exception {
-        String url = connectionString + ";trustManagerClass=" + InvalidTrustManager.class.getName() + ";encrypt=true;";
+        String url = TestUtils.removeProperty(connectionString, Constants.TRUST_SERVER_CERTIFICATE);
+        url = url + "encrypt=true;trustManagerClass=" + InvalidTrustManager.class.getName();
         try (Connection con = PrepUtil.getConnection(url)) {
             fail(TestResource.getResource("R_expectedFailPassed"));
         } catch (SQLException e) {
             assertTrue(e.getMessage().contains(
-                    "The class specified by the trustManagerClass property must be assignable to javax.net.ssl.TrustManager."));
+                    "The class specified by the trustManagerClass property must be assignable to javax.net.ssl.TrustManager."),
+                    e.getMessage());
         }
     }
 }
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPAllTypesTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPAllTypesTest.java
index 9fef3a91..fdb4c7de 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPAllTypesTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPAllTypesTest.java
@@ -45,7 +45,6 @@ public class TVPAllTypesTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPIssuesTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPIssuesTest.java
index e97b69a3..e110ccda 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPIssuesTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPIssuesTest.java
@@ -133,7 +133,6 @@ public class TVPIssuesTest extends AbstractTest {
 
     @BeforeAll
     public static void beforeAll() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         try (Connection connection = getConnection(); Statement stmt = connection.createStatement()) {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPNumericTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPNumericTest.java
index 231e9adf..0c310160 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPNumericTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPNumericTest.java
@@ -95,7 +95,6 @@ public class TVPNumericTest extends AbstractTest {
 
     @BeforeAll
     public static void testSetup() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         tvpName = RandomUtil.getIdentifier("numericTVP");
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPResultSetCursorTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPResultSetCursorTest.java
index 1e5c4e27..69060eb7 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPResultSetCursorTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPResultSetCursorTest.java
@@ -57,7 +57,6 @@ public class TVPResultSetCursorTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPSchemaTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPSchemaTest.java
index 63c39b04..075c9f2c 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPSchemaTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPSchemaTest.java
@@ -132,7 +132,6 @@ public class TVPSchemaTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPTypesTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPTypesTest.java
index 37eb1ea2..e56ec220 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPTypesTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPTypesTest.java
@@ -668,7 +668,6 @@ public class TVPTypesTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/SQLServerErrorTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/SQLServerErrorTest.java
index 834e6da4..b4ca10c0 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/SQLServerErrorTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/SQLServerErrorTest.java
@@ -36,7 +36,6 @@ public class SQLServerErrorTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/SavepointTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/SavepointTest.java
index 8b3f62af..63a9c956 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/SavepointTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/SavepointTest.java
@@ -36,7 +36,6 @@ public class SavepointTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/UTF8SupportTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/UTF8SupportTest.java
index 0b509b7f..263366b0 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/UTF8SupportTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/UTF8SupportTest.java
@@ -107,7 +107,6 @@ public class UTF8SupportTest extends AbstractTest {
 
     @BeforeAll
     public static void setUp() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         assert (TestUtils.serverSupportsUTF8(connection));
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/lobs/LobsStreamingTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/lobs/LobsStreamingTest.java
index 466b80f2..c8b48a5b 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/lobs/LobsStreamingTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/lobs/LobsStreamingTest.java
@@ -39,7 +39,6 @@ public class LobsStreamingTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/lobs/LobsTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/lobs/LobsTest.java
index a2856c2e..82becbcd 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/lobs/LobsTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/lobs/LobsTest.java
@@ -79,7 +79,6 @@ public class LobsTest extends AbstractTest {
 
     @BeforeAll
     public static void init() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         tableName = RandomUtil.getIdentifier("LOBS");
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/serial/DTOSerialTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/serial/DTOSerialTest.java
index 09cdfe7d..9b462d40 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/serial/DTOSerialTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/serial/DTOSerialTest.java
@@ -38,7 +38,6 @@ public class DTOSerialTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchExecuteWithErrorsTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchExecuteWithErrorsTest.java
index a5371ad5..5744b977 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchExecuteWithErrorsTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchExecuteWithErrorsTest.java
@@ -53,7 +53,6 @@ public class BatchExecuteWithErrorsTest extends AbstractTest {
 
 	@BeforeAll
 	public static void setupTests() throws Exception {
-		connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
 		setConnection();
 	}
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchExecutionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchExecutionTest.java
index 775cf58a..b74d99cb 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchExecutionTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchExecutionTest.java
@@ -242,7 +242,6 @@ public class BatchExecutionTest extends AbstractTest {
 
     @BeforeAll
     public static void testSetup() throws TestAbortedException, Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         ctstable1 = RandomUtil.getIdentifier("ctstable1");
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchTriggerTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchTriggerTest.java
index 67c1266d..777dbac1 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchTriggerTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchTriggerTest.java
@@ -107,7 +107,6 @@ public class BatchTriggerTest extends AbstractTest {
      */
     @BeforeAll
     public static void testSetup() throws TestAbortedException, Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         tableName = RandomUtil.getIdentifier("triggerTable");
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/CallableMixedTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/CallableMixedTest.java
index defbce66..ab8d4ce2 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/CallableMixedTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/CallableMixedTest.java
@@ -37,7 +37,6 @@ public class CallableMixedTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/LimitEscapeTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/LimitEscapeTest.java
index dc84a3b0..e54b6760 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/LimitEscapeTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/LimitEscapeTest.java
@@ -893,7 +893,6 @@ public class LimitEscapeTest extends AbstractTest {
      */
     @BeforeAll
     public static void beforeAll() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         try {
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/MergeTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/MergeTest.java
index c042fb3e..67ce9c36 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/MergeTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/MergeTest.java
@@ -38,7 +38,6 @@ public class MergeTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/NamedParamMultiPartTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/NamedParamMultiPartTest.java
index 3c55f88b..aa4b8588 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/NamedParamMultiPartTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/NamedParamMultiPartTest.java
@@ -44,7 +44,6 @@ public class NamedParamMultiPartTest extends AbstractTest {
      */
     @BeforeAll
     public static void beforeAll() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         procedureName = RandomUtil.getIdentifier("mystoredproc");
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PQImpsTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PQImpsTest.java
index 99947cca..22080f48 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PQImpsTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PQImpsTest.java
@@ -67,7 +67,6 @@ public class PQImpsTest extends AbstractTest {
      */
     @BeforeAll
     public static void BeforeTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
 
         connection = getConnection();
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PoolableTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PoolableTest.java
index b5725363..86b34b71 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PoolableTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PoolableTest.java
@@ -37,7 +37,6 @@ public class PoolableTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PreparedStatementTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PreparedStatementTest.java
index 061f1468..5fc74e47 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PreparedStatementTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PreparedStatementTest.java
@@ -51,7 +51,6 @@ public class PreparedStatementTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/RegressionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/RegressionTest.java
index 350e6144..9785f0ed 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/RegressionTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/RegressionTest.java
@@ -39,7 +39,6 @@ public class RegressionTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementCancellationTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementCancellationTest.java
index ec3764c7..9db593b2 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementCancellationTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementCancellationTest.java
@@ -31,7 +31,6 @@ public class StatementCancellationTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java
index a9cdf27b..ba737597 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java
@@ -66,7 +66,6 @@ public class StatementTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/WrapperTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/WrapperTest.java
index 3343bc5e..1fdf54ac 100644
--- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/WrapperTest.java
+++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/WrapperTest.java
@@ -32,7 +32,6 @@ public class WrapperTest extends AbstractTest {
 
     @BeforeAll
     public static void setupTests() throws Exception {
-        connectionString = TestUtils.addOrOverrideProperty(connectionString,"trustServerCertificate", "true");
         setConnection();
     }
 
diff --git a/src/test/java/com/microsoft/sqlserver/testframework/AbstractTest.java b/src/test/java/com/microsoft/sqlserver/testframework/AbstractTest.java
index 7a563b93..678451f1 100644
--- a/src/test/java/com/microsoft/sqlserver/testframework/AbstractTest.java
+++ b/src/test/java/com/microsoft/sqlserver/testframework/AbstractTest.java
@@ -69,7 +69,11 @@ public abstract class AbstractTest {
     protected static String clientKey = null;
     protected static String clientKeyPassword = "";
 
-    protected static String trustStorePath = "";
+    protected static String trustStore = "";
+    protected static String trustStorePassword = "";
+
+    protected static String encrypt = "";
+    protected static String trustServerCertificate = "";
 
     protected static String windowsKeyPath = null;
     protected static String javaKeyPath = null;
@@ -134,6 +138,13 @@ public abstract class AbstractTest {
         applicationKey = getConfiguredProperty("applicationKey");
         tenantID = getConfiguredProperty("tenantID");
 
+        encrypt = getConfiguredProperty("encrypt", "false");
+        connectionString = TestUtils.addOrOverrideProperty(connectionString, "encrypt", encrypt);
+
+        trustServerCertificate = getConfiguredProperty("trustServerCertificate", "true");
+        connectionString = TestUtils.addOrOverrideProperty(connectionString, "trustServerCertificate",
+                trustServerCertificate);
+
         javaKeyPath = TestUtils.getCurrentClassPath() + Constants.JKS_NAME;
 
         keyIDs = getConfiguredProperty("keyID", "").split(Constants.SEMI_COLON);
@@ -163,7 +174,16 @@ public abstract class AbstractTest {
 
         clientKeyPassword = getConfiguredProperty("clientKeyPassword", "");
 
-        trustStorePath = getConfiguredProperty("trustStore", "");
+        trustStore = getConfiguredProperty("trustStore", "");
+        if (!(trustStore.isBlank() || trustStore.isEmpty())) {
+            connectionString = TestUtils.addOrOverrideProperty(connectionString, "trustStore", trustStore);
+        }
+
+        trustStorePassword = getConfiguredProperty("trustStorePassword", "");
+        if (!(trustStorePassword.isBlank() || trustStorePassword.isEmpty())) {
+            connectionString = TestUtils.addOrOverrideProperty(connectionString, "trustStorePassword",
+                    trustStorePassword);
+        }
 
         Map<String, SQLServerColumnEncryptionKeyStoreProvider> map = new HashMap<String, SQLServerColumnEncryptionKeyStoreProvider>();
         if (null == jksProvider) {
@@ -318,11 +338,20 @@ public abstract class AbstractTest {
                             ds.setCancelQueryTimeout(Integer.parseInt(value));
                             break;
                         case Constants.ENCRYPT:
-                            ds.setEncrypt(Boolean.parseBoolean(value));
+                            ds.setEncrypt(value);
                             break;
                         case Constants.TRUST_SERVER_CERTIFICATE:
                             ds.setTrustServerCertificate(Boolean.parseBoolean(value));
                             break;
+                        case Constants.TRUST_STORE:
+                            ds.setTrustStore(value);
+                            break;
+                        case Constants.TRUST_STORE_SECRET_PROPERTY:
+                            ds.setTrustStorePassword(value);
+                            break;
+                        case Constants.TRUST_STORE_TYPE:
+                            ds.setTrustStoreType(value);
+                            break;
                         case Constants.HOST_NAME_IN_CERTIFICATE:
                             ds.setHostNameInCertificate(value);
                             break;
diff --git a/src/test/java/com/microsoft/sqlserver/testframework/Constants.java b/src/test/java/com/microsoft/sqlserver/testframework/Constants.java
index 00ba22ed..f6507619 100644
--- a/src/test/java/com/microsoft/sqlserver/testframework/Constants.java
+++ b/src/test/java/com/microsoft/sqlserver/testframework/Constants.java
@@ -118,6 +118,11 @@ public final class Constants {
     public static final String CEK_STRING = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
     public static final String CEK_ENCRYPTED_VALUE = "0x016E000001630075007200720065006E00740075007300650072002F006D0079002F006100320032003600650031003800310034003300350063003300370065003800660035003500330035003500660066006100340037003400340062003600330035003600610031006200650035003500A83E74C244AD62ED7D83FDEAED3923B4D843BBB8FDE1ECFEE11DB5275144BC936FD3485D157B4921A6CF12EEEAD52F6BAB5822383C7101508523C51858A1487FD10173CD945159418B70DD9FF432D28B453146FA72F90CFA90810B0E905C95FD99D1CA4009BA3D56C783853751EA74482C53C49667C62DD588452473FFECA835B5233B1BDACD4C461560635204DF8EE674C0A3AD63E4C63D787B6602B0902306DC145354C05B7DD74EDED34D5DE4F05379851E36612C9D3BA3B8551BC558FCF7F705711D22AD4C7CD99931662B73DD647B1B3C1FB109A5850919EFB75774F64ECBEBD7808A0D69FBE124906CDD39B7552B03712FDF9B46399766E79B6BFCBBC75267496B257E40BA05CDB4E294C7353A2FCEA7C0983BF5E1599B71B2C975A682D29CDC9CEEEFE8E11676004C6F1217FB7726451A708A7C1F6CADEB00D2D81110771DEB9050B244B20DC787C58FBD07F2B4AE7467422249A4134D63E09BE26ED165EB1393F313B1877399C803B61E1860F5D8223054DD1F07835492C3AEFA48FDF71F123D7DE430DD1EA69D82B91B85176BF46306FC3D68CC43497A9D625584213BEF754FB0E8D64201FEA74DAE37E3D3BF6D58D1A7CA9502173C192E038DD7CEB5A16A7982044538021AE7B96A94B9941AF87AE879032F783108729EB366114DFCF7A68B440F26D752BEAE6433E90F857C13EAB1CCE1EC42D9897893488E4182";
 
+    // Encrypt Options
+    public static final String FALSE = "FALSE";
+    public static final String TRUE = "TRUE";
+    public static final String STRICT = "STRICT";
+    
     // Start: Connection Properties parsed in AbstractTest class for creating DataSource.
     public static final String INTEGRATED_SECURITY = "INTEGRATEDSECURITY";
     public static final String USER = "USER";