Skip to content

Commit a653ea3

Browse files
committed
Merge branch 'attestation-none-option' of https://github.com/microsoft/mssql-jdbc into attestation-none-option
2 parents f4656be + 866d2bf commit a653ea3

File tree

127 files changed

+338
-270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+338
-270
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ We're now on the Maven Central Repository. Add the following to your POM file to
8080
<dependency>
8181
<groupId>com.microsoft.sqlserver</groupId>
8282
<artifactId>mssql-jdbc</artifactId>
83-
<version>10.2.0.jre17</version>
83+
<version>11.1.0.jre17</version>
8484
</dependency>
8585
```
8686
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:
9191
<dependency>
9292
<groupId>com.microsoft.sqlserver</groupId>
9393
<artifactId>mssql-jdbc</artifactId>
94-
<version>10.2.0.jre17</version>
94+
<version>11.1.0.jre17</version>
9595
</dependency>
9696
```
9797

@@ -126,7 +126,7 @@ Projects that require either of the two features need to explicitly declare the
126126
<dependency>
127127
<groupId>com.microsoft.sqlserver</groupId>
128128
<artifactId>mssql-jdbc</artifactId>
129-
<version>10.2.0.jre17</version>
129+
<version>11.1.0.jre17</version>
130130
<scope>compile</scope>
131131
</dependency>
132132

@@ -144,7 +144,7 @@ Projects that require either of the two features need to explicitly declare the
144144
<dependency>
145145
<groupId>com.microsoft.sqlserver</groupId>
146146
<artifactId>mssql-jdbc</artifactId>
147-
<version>10.2.0.jre17</version>
147+
<version>11.1.0.jre17</version>
148148
<scope>compile</scope>
149149
</dependency>
150150

@@ -171,7 +171,7 @@ When setting 'useFmtOnly' property to 'true' for establishing a connection or cr
171171
<dependency>
172172
<groupId>com.microsoft.sqlserver</groupId>
173173
<artifactId>mssql-jdbc</artifactId>
174-
<version>10.2.0.jre17</version>
174+
<version>11.1.0.jre17</version>
175175
</dependency>
176176

177177
<dependency>
@@ -211,7 +211,7 @@ Preview releases happen approximately monthly between stable releases. This give
211211
You can see what is going into a future release by monitoring [Milestones](https://github.com/Microsoft/mssql-jdbc/milestones) in the repository.
212212

213213
### Version conventions
214-
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.
214+
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.
215215

216216
## Contributors
217217
Special thanks to everyone who has contributed to the project.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
apply plugin: 'java'
1313

14-
version = '10.3.0-SNAPSHOT'
14+
version = '11.1.0-SNAPSHOT'
1515
def jreVersion = ""
1616
def testOutputDir = file("build/classes/java/test")
1717
def archivesBaseName = 'mssql-jdbc'

mssql-jdbc_auth_LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
MICROSOFT SOFTWARE LICENSE TERMS
2-
MICROSOFT JDBC DRIVER 10.2 FOR SQL SERVER
2+
MICROSOFT JDBC DRIVER 11.1 FOR SQL SERVER
33

44
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.
55

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.microsoft.sqlserver</groupId>
88
<artifactId>mssql-jdbc</artifactId>
9-
<version>10.3.0-SNAPSHOT</version>
9+
<version>11.1.0-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Microsoft JDBC Driver for SQL Server</name>

src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,6 @@ final InetSocketAddress open(String host, int port, int timeoutMillis, boolean u
761761
channelSocket = tcpSocket = socketFinder.findSocket(host, port, timeoutMillis, useParallel, useTnir,
762762
isTnirFirstAttempt, timeoutMillisForFullTimeout);
763763
try {
764-
765764
// Set socket options
766765
tcpSocket.setTcpNoDelay(true);
767766
tcpSocket.setKeepAlive(true);
@@ -1828,8 +1827,8 @@ enum SSLHandhsakeState {
18281827
* Private key file's password
18291828
* @throws SQLServerException
18301829
*/
1831-
void enableSSL(String host, int port, String clientCertificate, String clientKey,
1832-
String clientKeyPassword) throws SQLServerException {
1830+
void enableSSL(String host, int port, String clientCertificate, String clientKey, String clientKeyPassword,
1831+
boolean isTDSS) throws SQLServerException {
18331832
// If enabling SSL fails, which it can for a number of reasons, the following items
18341833
// are used in logging information to the TDS channel logger to help diagnose the problem.
18351834
Provider tmfProvider = null; // TrustManagerFactory provider
@@ -1870,12 +1869,11 @@ void enableSSL(String host, int port, String clientCertificate, String clientKey
18701869
validateFips(trustStoreType, trustStoreFileName);
18711870
}
18721871

1873-
assert TDS.ENCRYPT_OFF == con.getRequestedEncryptionLevel() || // Login only SSL
1874-
TDS.ENCRYPT_ON == con.getRequestedEncryptionLevel(); // Full SSL
1875-
1876-
assert TDS.ENCRYPT_OFF == con.getNegotiatedEncryptionLevel() || // Login only SSL
1877-
TDS.ENCRYPT_ON == con.getNegotiatedEncryptionLevel() || // Full SSL
1878-
TDS.ENCRYPT_REQ == con.getNegotiatedEncryptionLevel(); // Full SSL
1872+
byte requestedEncryptLevel = con.getRequestedEncryptionLevel();
1873+
assert TDS.ENCRYPT_OFF == requestedEncryptLevel || // Login only SSL
1874+
TDS.ENCRYPT_ON == requestedEncryptLevel || // Full SSL
1875+
TDS.ENCRYPT_REQ == requestedEncryptLevel || // Full SSL
1876+
(isTDSS && TDS.ENCRYPT_NOT_SUP == requestedEncryptLevel); // TDSS
18791877

18801878
// If encryption wasn't negotiated or trust server certificate is specified,
18811879
// then we'll "validate" the server certificate using a naive TrustManager that trusts
@@ -2004,13 +2002,17 @@ else if (con.getTrustManagerClass() != null) {
20042002
// Got the SSL context. Now create an SSL socket over our own proxy socket
20052003
// which we can toggle between TDS-encapsulated and raw communications.
20062004
// Initially, the proxy is set to encapsulate the SSL handshake in TDS packets.
2007-
proxySocket = new ProxySocket(this);
2008-
20092005
if (logger.isLoggable(Level.FINEST))
20102006
logger.finest(toString() + " Creating SSL socket");
20112007

2012-
// don't close proxy when SSL socket is closed
2013-
sslSocket = (SSLSocket) sslContext.getSocketFactory().createSocket(proxySocket, host, port, false);
2008+
proxySocket = new ProxySocket(this);
2009+
2010+
if (isTDSS) {
2011+
sslSocket = (SSLSocket) sslContext.getSocketFactory().createSocket(host, port);
2012+
} else {
2013+
// don't close proxy when SSL socket is closed
2014+
sslSocket = (SSLSocket) sslContext.getSocketFactory().createSocket(proxySocket, host, port, false);
2015+
}
20142016

20152017
// At long last, start the SSL handshake ...
20162018
if (logger.isLoggable(Level.FINER))
@@ -2053,6 +2055,7 @@ else if (con.getTrustManagerClass() != null) {
20532055

20542056
if (logger.isLoggable(Level.FINER))
20552057
logger.finer(toString() + " SSL enabled");
2058+
20562059
} catch (Exception e) {
20572060
// Log the original exception and its source at FINER level
20582061
if (logger.isLoggable(Level.FINER))

src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,32 @@ public interface ISQLServerDataSource extends javax.sql.CommonDataSource {
101101
boolean getLastUpdateCount();
102102

103103
/**
104-
* Sets a Boolean value that indicates if the encrypt property is enabled.
104+
* Sets the option whether TLS encryption is used.
105105
*
106-
* @param encrypt
107-
* true if the Secure Sockets Layer (SSL) encryption is enabled between the client and the SQL Server.
108-
* Otherwise, false.
106+
* @param encryptOption
107+
* TLS encrypt option. Default is "true"
109108
*/
110-
void setEncrypt(boolean encrypt);
109+
void setEncrypt(String encryptOption);
111110

112111
/**
113-
* Returns a Boolean value that indicates if the encrypt property is enabled.
112+
* Sets the option whether TLS encryption is used.
114113
*
115-
* @return true if encrypt is enabled. Otherwise, false.
114+
* @deprecated Use {@link ISQLServerDataSource#setEncrypt(String encryptOption)} instead
115+
* @param encryptOption
116+
* TLS encrypt option. Default is true
116117
*/
117-
boolean getEncrypt();
118+
@Deprecated
119+
void setEncrypt(boolean encryptOption);
120+
121+
/**
122+
* Returns the TLS encryption option.
123+
*
124+
* @return the TLS encrypt option
125+
*/
126+
String getEncrypt();
118127

119128
/**
120-
* Sets the value to enable/disable Transparent Netowrk IP Resolution (TNIR). Beginning in version 6.0 of the
129+
* Sets the value to enable/disable Transparent Network IP Resolution (TNIR). Beginning in version 6.0 of the
121130
* Microsoft JDBC Driver for SQL Server, a new connection property transparentNetworkIPResolution (TNIR) is added
122131
* for transparent connection to Always On availability groups or to a server which has multiple IP addresses
123132
* 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 {
143152
boolean getTransparentNetworkIPResolution();
144153

145154
/**
146-
* Sets a Boolean value that indicates if the trustServerCertificate property is enabled.
155+
* Sets a boolean value that indicates if the trustServerCertificate property is enabled.
147156
*
148157
* @param e
149158
* true, if the server Secure Sockets Layer (SSL) certificate should be automatically trusted when the
150-
* communication layer is encrypted using SSL. Otherwise, false.
159+
* communication layer is encrypted using SSL. false, if server SLL certificate should not be trusted
160+
* certificate location, if encrypt=strict
151161
*/
152162
void setTrustServerCertificate(boolean e);
153163

154164
/**
155-
* Returns a Boolean value that indicates if the trustServerCertificate property is enabled.
165+
* Returns a boolean value that indicates if the trustServerCertificate property is enabled.
156166
*
157-
* @return true if trustServerCertificate is enabled. Otherwise, false.
167+
* @return true if trustServerCertificate is enabled. Otherwise, false. If encrypt=strict, returns server
168+
* certificate location
158169
*/
159170
boolean getTrustServerCertificate();
160171

src/main/java/com/microsoft/sqlserver/jdbc/SQLJdbcVersion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
package com.microsoft.sqlserver.jdbc;
77

88
final class SQLJdbcVersion {
9-
static final int major = 10;
10-
static final int minor = 3;
9+
static final int major = 11;
10+
static final int minor = 1;
1111
static final int patch = 0;
1212
static final int build = 0;
1313
/*

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkRecord.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Abstract class that implements ISQLServerBulkRecord
1616
*
1717
*/
18+
@SuppressWarnings("deprecation")
1819
abstract class SQLServerBulkRecord implements ISQLServerBulkRecord {
1920

2021
/**

0 commit comments

Comments
 (0)