Skip to content

Commit 7b4e8c7

Browse files
author
Gabriela Martinez
committed
Merge branch '6.8' of myrepo.no.oracle.com:connector-net into 6.8
2 parents fb527bd + 893f8d9 commit 7b4e8c7

File tree

12 files changed

+25
-28
lines changed

12 files changed

+25
-28
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
- Fix for Nested transactions are not supported in Entity Framework (MySQL Bug #71502, Oracle Bug #22366266).
33
- Fix for EF5 and EF6 wrong SQL statement to set primary key (MySQL Bug 76292, Oracle Bug #20711384)
44
- Fixed problem where mysql.proc tables would not be used for metadata even though access was available (MySQL Bug #74116, Oracle Bug #20960373)
5+
- Added support for TLSv1.1 and TLSv1.2
56
- Fixed Fix for "Aborted connection" (MySQL Bug #80997, Oracle Bug # 23346197).
67

8+
79
6.8.7
810
- Changed handshake process to use bytes instead of encoded strings.
911
- Added support for Chinese character set gb18030. (Oracle bug # 21098546).

Source/MySql.Data/NativeDriver.cs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ internal class NativeDriver : IDriver
6060
private Driver owner;
6161
private int warnings;
6262
private MySqlAuthenticationPlugin authPlugin;
63+
private bool isEnterprise;
6364

6465
// Windows authentication method string, used by the protocol.
6566
// Also known as "client plugin name".
@@ -222,6 +223,7 @@ public void Open()
222223
packet = stream.ReadPacket();
223224
int protocol = packet.ReadByte();
224225
string versionString = packet.ReadString();
226+
isEnterprise = versionString.ToLowerInvariant().Contains("-enterprise-");
225227
version = DBVersion.Parse(versionString);
226228
if (!version.isAtLeast(5, 0, 0))
227229
throw new NotSupportedException(Resources.ServerTooOld);
@@ -379,11 +381,16 @@ private void StartSSL()
379381
new RemoteCertificateValidationCallback(ServerCheckValidation);
380382
SslStream ss = new SslStream(baseStream, true, sslValidateCallback, null);
381383
X509CertificateCollection certs = GetClientCertificates();
382-
ss.AuthenticateAsClient(Settings.Server, certs, SslProtocols.Tls, false);
384+
SslProtocols sslProtocols = SslProtocols.Tls;
385+
#if NET_45_OR_GREATER
386+
sslProtocols |= SslProtocols.Tls11;
387+
if (version.isAtLeast(5, 6, 0) && isEnterprise)
388+
sslProtocols |= SslProtocols.Tls12;
389+
#endif
390+
ss.AuthenticateAsClient(Settings.Server, certs, sslProtocols, false);
383391
baseStream = ss;
384392
stream = new MySqlStream(ss, Encoding, false);
385393
stream.SequenceByte = 2;
386-
387394
}
388395

389396
private bool ServerCheckValidation(object sender, X509Certificate certificate,
@@ -410,16 +417,16 @@ private bool ServerCheckValidation(object sender, X509Certificate certificate,
410417
}
411418

412419

413-
#endregion
420+
#endregion
414421

415422
#endif
416423

417-
#region Authentication
424+
#region Authentication
418425

419-
/// <summary>
420-
/// Return the appropriate set of connection flags for our
421-
/// server capabilities and our user requested options.
422-
/// </summary>
426+
/// <summary>
427+
/// Return the appropriate set of connection flags for our
428+
/// server capabilities and our user requested options.
429+
/// </summary>
423430
private void SetConnectionFlags(ClientFlags serverCaps)
424431
{
425432
// allow load data local infile

Source/MySql.Data/transaction.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,16 @@ public void Dispose()
8989
GC.SuppressFinalize(this);
9090
}
9191

92+
#if RT
93+
protected void Dispose(bool disposing)
94+
#else
9295
protected override void Dispose(bool disposing)
96+
#endif
9397
{
9498
if (disposed) return;
99+
#if !RT
95100
base.Dispose(disposing);
101+
#endif
96102
if (disposing)
97103
{
98104
if ((conn != null && conn.State == ConnectionState.Open || conn.SoftClosed) && open)

Tests/MySql.Data.Tests/MySqlConnectionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2013, 2015 Oracle and/or its affiliates. All rights reserved.
1+
// Copyright © 2013, 2016 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
@@ -1341,7 +1341,7 @@ public void SslPreferredByDefault()
13411341
using (MySqlDataReader reader = command.ExecuteReader())
13421342
{
13431343
Assert.True(reader.Read());
1344-
Assert.Equal("TLSv1", reader.GetString(1));
1344+
Assert.True(reader.GetString(1).StartsWith("TLSv1"));
13451345
}
13461346
}
13471347
}

Tests/MySql.Data.Tests/certificates/ca-cert.pem

Lines changed: 0 additions & 18 deletions
This file was deleted.
28 Bytes
Binary file not shown.
1.07 KB
Binary file not shown.
-2.39 KB
Binary file not shown.
28 Bytes
Binary file not shown.
-2.39 KB
Binary file not shown.

0 commit comments

Comments
 (0)