@@ -1765,14 +1765,14 @@ private void registerKeyStoreProviderOnConnection(String keyStoreAuth, String ke
17651765 }
17661766 }
17671767
1768- private void setKeyStoreSecretAndLocation (String keyStoreSecret , String keyStoreLocation ) throws SQLServerException {
1768+ private void setKeyStoreSecretAndLocation (String keyStoreSecret ,
1769+ String keyStoreLocation ) throws SQLServerException {
17691770 // both secret and location must be set for JKS.
17701771 if ((null == keyStoreSecret ) || (null == keyStoreLocation )) {
1771- throw new SQLServerException (
1772- SQLServerException .getErrString ("R_keyStoreSecretOrLocationNotSet" ), null );
1772+ throw new SQLServerException (SQLServerException .getErrString ("R_keyStoreSecretOrLocationNotSet" ), null );
17731773 } else {
17741774 SQLServerColumnEncryptionJavaKeyStoreProvider provider = new SQLServerColumnEncryptionJavaKeyStoreProvider (
1775- keyStoreLocation , keyStoreSecret .toCharArray ());
1775+ keyStoreLocation , keyStoreSecret .toCharArray ());
17761776 systemColumnEncryptionKeyStoreProvider .put (provider .getName (), provider );
17771777 }
17781778 }
@@ -1959,14 +1959,15 @@ Connection connectInternal(Properties propsIn,
19591959 if (null != sPropValuePort ) {
19601960 trustedServerNameAE += ":" + sPropValuePort ;
19611961 }
1962-
1962+
19631963 sPropKey = SQLServerDriverStringProperty .IPADDRESS_PREFERENCE .toString ();
19641964 sPropValue = activeConnectionProperties .getProperty (sPropKey );
19651965 if (null == sPropValue ) {
19661966 sPropValue = SQLServerDriverStringProperty .IPADDRESS_PREFERENCE .getDefaultValue ();
19671967 activeConnectionProperties .setProperty (sPropKey , sPropValue );
19681968 } else {
1969- activeConnectionProperties .setProperty (sPropKey , IPAddressPreference .valueOfString (sPropValue ).toString ());
1969+ activeConnectionProperties .setProperty (sPropKey ,
1970+ IPAddressPreference .valueOfString (sPropValue ).toString ());
19701971 }
19711972
19721973 sPropKey = SQLServerDriverStringProperty .APPLICATION_NAME .toString ();
@@ -2016,8 +2017,8 @@ Connection connectInternal(Properties propsIn,
20162017
20172018 // enclave requires columnEncryption=enabled, enclaveAttestationUrl and enclaveAttestationProtocol
20182019 if (
2019- // An attestation URL requires a protocol
2020- (null != enclaveAttestationUrl && !enclaveAttestationUrl .isEmpty ()
2020+ // An attestation URL requires a protocol
2021+ (null != enclaveAttestationUrl && !enclaveAttestationUrl .isEmpty ()
20212022 && (null == enclaveAttestationProtocol || enclaveAttestationProtocol .isEmpty ()))
20222023
20232024 // An attestation protocol that is not NONE requires a URL
@@ -2073,7 +2074,8 @@ Connection connectInternal(Properties propsIn,
20732074 SQLServerException .getErrString ("R_keyVaultProviderClientKeyNotSet" ), null );
20742075 }
20752076 String keyVaultColumnEncryptionProviderClientKey = sPropValue ;
2076- setKeyVaultProvider (keyVaultColumnEncryptionProviderClientId , keyVaultColumnEncryptionProviderClientKey );
2077+ setKeyVaultProvider (keyVaultColumnEncryptionProviderClientId ,
2078+ keyVaultColumnEncryptionProviderClientKey );
20772079 }
20782080
20792081 sPropKey = SQLServerDriverBooleanProperty .MULTI_SUBNET_FAILOVER .toString ();
@@ -3265,7 +3267,8 @@ private InetSocketAddress connectHelper(ServerPortPlaceHolder serverInfo, int ti
32653267
32663268 // if the timeout is infinite slices are infinite too.
32673269 tdsChannel = new TDSChannel (this );
3268- String iPAddressPreference = activeConnectionProperties .getProperty (SQLServerDriverStringProperty .IPADDRESS_PREFERENCE .toString ());
3270+ String iPAddressPreference = activeConnectionProperties
3271+ .getProperty (SQLServerDriverStringProperty .IPADDRESS_PREFERENCE .toString ());
32693272
32703273 InetSocketAddress inetSocketAddress = tdsChannel .open (serverInfo .getParsedServerName (),
32713274 serverInfo .getPortNumber (), (0 == timeOutFullInSeconds ) ? 0 : timeOutSliceInMillis , useParallel ,
@@ -3688,7 +3691,7 @@ void prelogin(String serverName, int portNumber) throws SQLServerException {
36883691 // If we say we don't support SSL and the server doesn't accept unencrypted connections,
36893692 // then terminate the connection.
36903693 if (TDS .ENCRYPT_NOT_SUP == requestedEncryptionLevel
3691- && TDS .ENCRYPT_NOT_SUP != negotiatedEncryptionLevel ) {
3694+ && TDS .ENCRYPT_NOT_SUP != negotiatedEncryptionLevel && ! isTDSS ) {
36923695 // If the server required an encrypted connection then terminate with an appropriate error.
36933696 if (TDS .ENCRYPT_REQ == negotiatedEncryptionLevel )
36943697 terminate (SQLServerException .DRIVER_ERROR_SSL_FAILED ,
@@ -4558,8 +4561,8 @@ int writeAEFeatureRequest(boolean write, /* if false just calculates the length
45584561 if (write ) {
45594562 tdsWriter .writeByte (TDS .TDS_FEATURE_EXT_AE ); // FEATUREEXT_TC
45604563 tdsWriter .writeInt (1 ); // length of version
4561- if (null == enclaveAttestationUrl || enclaveAttestationUrl .isEmpty () || (enclaveAttestationProtocol != null
4562- && !enclaveAttestationProtocol .equalsIgnoreCase (AttestationProtocol .NONE .toString ()))) {
4564+ if (null == enclaveAttestationUrl || enclaveAttestationUrl .isEmpty () || (enclaveAttestationProtocol != null
4565+ && !enclaveAttestationProtocol .equalsIgnoreCase (AttestationProtocol .NONE .toString ()))) {
45634566 tdsWriter .writeByte (TDS .COLUMNENCRYPTION_VERSION1 );
45644567 } else {
45654568 tdsWriter .writeByte (TDS .COLUMNENCRYPTION_VERSION2 );
@@ -5678,8 +5681,8 @@ private void onFeatureExtAck(byte featureId, byte[] data) throws SQLServerExcept
56785681
56795682 serverColumnEncryptionVersion = ColumnEncryptionVersion .AE_V1 ;
56805683
5681- if (null != enclaveAttestationUrl || (enclaveAttestationProtocol != null
5682- && enclaveAttestationProtocol .equalsIgnoreCase (AttestationProtocol .NONE .toString ()))) {
5684+ if (null != enclaveAttestationUrl || (enclaveAttestationProtocol != null
5685+ && enclaveAttestationProtocol .equalsIgnoreCase (AttestationProtocol .NONE .toString ()))) {
56835686 if (aeVersion < TDS .COLUMNENCRYPTION_VERSION2 ) {
56845687 throw new SQLServerException (SQLServerException .getErrString ("R_enclaveNotSupported" ), null );
56855688 } else {
@@ -7666,8 +7669,9 @@ String getServerName() {
76667669
76677670 @ Override
76687671 public void setIPAddressPreference (String iPAddressPreference ) {
7669- activeConnectionProperties .setProperty (SQLServerDriverStringProperty .IPADDRESS_PREFERENCE .toString (), iPAddressPreference );
7670-
7672+ activeConnectionProperties .setProperty (SQLServerDriverStringProperty .IPADDRESS_PREFERENCE .toString (),
7673+ iPAddressPreference );
7674+
76717675 }
76727676
76737677 @ Override
0 commit comments