Skip to content

Commit cd7a6bd

Browse files
author
Roberto E. Garcia
committed
Merge branch '6.7' into 6.8
2 parents b194925 + 3dc8e43 commit cd7a6bd

File tree

4 files changed

+41
-4
lines changed

4 files changed

+41
-4
lines changed

CHANGES

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
6.8.6
2+
- Changed default SSL mode to Preferred in connection string. Now the server connections will be using SSL if server allows it by default but it's possible to override this configuration.
3+
4+
15
6.8.5
26
- Fix for Exception "The given key was not present in the dictionary" when using utf16le charset in a query. (MySql #72737, Oracle Bug #19355906)
37
- Fix for Memory leak in a loop opening a connection to the database and executing a command (MySql Bug #73122, Oracle Bug #19467233).
@@ -35,7 +39,7 @@
3539
- Fix for MySQL Connector/NET generates incorrect SQL for LINQ 'StartsWith' queries (MySql bug #72058, Oracle bug #19680236).
3640
- Fix for Exception when using IEnumerable.Contains(model.property) in Where predicate (MySql bug #73643, Oracle bug #19690370).
3741
- Fix for Generated Sql does not contain ORDER BY statement whose is requested by LINQ (MySql bug #73549, Oracle bug #19698010).
38-
- Fix for Error of "Every derived table must have an alias" in LINQ to Entities when using EF6 + DbFirst + View + Take
42+
- Fix for Error of "Every derived table must have an alias" in LINQ to Entities when using EF6 + DbFirst + View + Take
3943
(MySql Bug #72148, Oracle bug #19356006).
4044
- Fix for 'the method or operation is not implemented' when using linq with orderby (MySQL Bug #70722, Oracle Bug #19681723).
4145

Source/MySql.Data/MySqlConnectionStringBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2013, 2014, Oracle and/or its affiliates. All rights reserved.
1+
// Copyright © 2013, 2015, Oracle and/or its affiliates. All rights reserved.
22
//
33
// MySQL Connector/NET is licensed under the terms of the GPLv2
44
// <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
@@ -185,7 +185,7 @@ static MySqlConnectionStringBuilder()
185185
options.Add(new MySqlConnectionStringOption("blobasutf8includepattern", null, typeof(string), "", false));
186186
options.Add(new MySqlConnectionStringOption("blobasutf8excludepattern", null, typeof(string), "", false));
187187
#if !CF
188-
options.Add(new MySqlConnectionStringOption("sslmode", "ssl mode", typeof(MySqlSslMode), MySqlSslMode.None, false));
188+
options.Add(new MySqlConnectionStringOption("sslmode", "ssl mode", typeof(MySqlSslMode), MySqlSslMode.Preferred, false));
189189
#endif
190190
}
191191

Source/MySql.Data/NativeDriver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ private void StartSSL()
376376
new RemoteCertificateValidationCallback(ServerCheckValidation);
377377
SslStream ss = new SslStream(baseStream, true, sslValidateCallback, null);
378378
X509CertificateCollection certs = GetClientCertificates();
379-
ss.AuthenticateAsClient(Settings.Server, certs, SslProtocols.Default, false);
379+
ss.AuthenticateAsClient(Settings.Server, certs, SslProtocols.Tls, false);
380380
baseStream = ss;
381381
stream = new MySqlStream(ss, Encoding, false);
382382
stream.SequenceByte = 2;

Tests/MySql.Data.Tests/MySqlConnectionTests.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,5 +1344,38 @@ public void GetSchemaCollectionAsync()
13441344
}
13451345
#endregion
13461346
#endif
1347+
1348+
[Fact]
1349+
public void SslPreferredByDefault()
1350+
{
1351+
string connectionString = st.GetConnectionString(true);
1352+
Assert.DoesNotContain("ssl", connectionString, StringComparison.OrdinalIgnoreCase);
1353+
using (MySqlConnection connection = new MySqlConnection(connectionString))
1354+
{
1355+
connection.Open();
1356+
MySqlCommand command = new MySqlCommand("SHOW SESSION STATUS LIKE 'Ssl_version';", connection);
1357+
using (MySqlDataReader reader = command.ExecuteReader())
1358+
{
1359+
Assert.True(reader.Read());
1360+
Assert.Equal("TLSv1", reader.GetString(1));
1361+
}
1362+
}
1363+
}
1364+
1365+
[Fact]
1366+
public void SslOverrided()
1367+
{
1368+
string connectionString = st.GetConnectionString(true) + ";Ssl mode=None";
1369+
using (MySqlConnection connection = new MySqlConnection(connectionString))
1370+
{
1371+
connection.Open();
1372+
MySqlCommand command = new MySqlCommand("SHOW SESSION STATUS LIKE 'Ssl_version';", connection);
1373+
using (MySqlDataReader reader = command.ExecuteReader())
1374+
{
1375+
Assert.True(reader.Read());
1376+
Assert.Equal(string.Empty, reader.GetString(1));
1377+
}
1378+
}
1379+
}
13471380
}
13481381
}

0 commit comments

Comments
 (0)