Skip to content

Commit 172d707

Browse files
author
Jose Ramirez
committed
Updated connection strings within unit tests to use the AllowPublicKeyRetrieval connection option when sslmode=none.
1 parent 5d313d1 commit 172d707

16 files changed

+42
-43
lines changed

Tests/MySql.Data.Tests/BlobTestsPipe.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, 2018, 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
@@ -38,7 +38,7 @@ public class BlobTestsPipe : BlobTests
3838
{
3939
protected override string OnGetConnectionStringInfo()
4040
{
41-
return String.Format("protocol=pipe;pipe name={0};ssl mode=none;", st.pipeName);
41+
return String.Format("protocol=pipe;pipe name={0};ssl mode=none;allowpublickeyretrieval=true;", st.pipeName);
4242
}
4343
}
4444
#endregion

Tests/MySql.Data.Tests/BlobTestsPipeCompressed.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, 2018, 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
@@ -38,7 +38,7 @@ public class BlobTestsPipeCompressed : BlobTests
3838
{
3939
protected override string OnGetConnectionStringInfo()
4040
{
41-
return String.Format("protocol=pipe;pipe name={0};compress=true;ssl mode=none;", st.pipeName);
41+
return String.Format("protocol=pipe;pipe name={0};compress=true;ssl mode=none;allowpublickeyretrieval=true;", st.pipeName);
4242
}
4343
}
4444
#endregion

Tests/MySql.Data.Tests/BlobTestsSharedMemory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class BlobTestsSharedMemory : BlobTests
3838
{
3939
protected override string OnGetConnectionStringInfo()
4040
{
41-
return String.Format("protocol=memory; shared memory name={0};ssl mode=none;", st.memoryName);
41+
return String.Format("protocol=memory; shared memory name={0};ssl mode=none;allowpublickeyretrieval=true;", st.memoryName);
4242
}
4343
}
4444
#endregion

Tests/MySql.Data.Tests/BlobTestsSharedMemoryCompressed.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, 2018, 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
@@ -38,7 +38,7 @@ public class BlobTestsSharedMemoryCompressed : BlobTests
3838
{
3939
protected override string OnGetConnectionStringInfo()
4040
{
41-
return String.Format("protocol=memory; shared memory name={0};compress=true;ssl mode=none;", st.memoryName);
41+
return String.Format("protocol=memory; shared memory name={0};compress=true;ssl mode=none;allowpublickeyretrieval=true;", st.memoryName);
4242
}
4343
}
4444
#endregion

Tests/MySql.Data.Tests/MySqlCommandTestsPipe.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, 2018, 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
@@ -37,7 +37,7 @@ public class MySqlCommandTestsPipe : MySqlCommandTests
3737
{
3838
protected override string OnGetConnectionStringInfo()
3939
{
40-
return String.Format("protocol=namedpipe;pipe name={0};ssl mode=none;", st.pipeName);
40+
return String.Format("protocol=namedpipe;pipe name={0};ssl mode=none;allowpublickeyretrieval=true;", st.pipeName);
4141
}
4242
}
4343
#endregion

Tests/MySql.Data.Tests/MySqlCommandTestsPipeCompressed.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, 2018, 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
@@ -37,7 +37,7 @@ public class MySqlCommandTestsPipeCompressed : MySqlCommandTests
3737
{
3838
protected override string OnGetConnectionStringInfo()
3939
{
40-
return String.Format("protocol=namedpipe;pipe name={0};compress=true;ssl mode=none;", st.pipeName);
40+
return String.Format("protocol=namedpipe;pipe name={0};compress=true;ssl mode=none;allowpublickeyretrieval=true;", st.pipeName);
4141
}
4242
}
4343
#endregion

Tests/MySql.Data.Tests/MySqlCommandTestsSharedMemory.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, 2018, 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
@@ -37,7 +37,7 @@ public class MySqlCommandTestsSharedMemory : MySqlCommandTests
3737
{
3838
protected override string OnGetConnectionStringInfo()
3939
{
40-
return String.Format("protocol=sharedmemory; shared memory name={0};ssl mode=none;", st.memoryName);
40+
return String.Format("protocol=sharedmemory; shared memory name={0};ssl mode=none;allowpublickeyretrieval=true;", st.memoryName);
4141
}
4242
}
4343
#endregion

Tests/MySql.Data.Tests/MySqlCommandTestsSharedMemoryCompressed.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, 2018, 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
@@ -37,7 +37,7 @@ public class MySqlCommandTestsSharedMemoryCompressed : MySqlCommandTests
3737
{
3838
protected override string OnGetConnectionStringInfo()
3939
{
40-
return String.Format("protocol=sharedmemory; shared memory name={0};compress=true;ssl mode=none;", st.memoryName);
40+
return String.Format("protocol=sharedmemory; shared memory name={0};compress=true;ssl mode=none;allowpublickeyretrieval=true;", st.memoryName);
4141
}
4242
}
4343
#endregion

Tests/MySql.Data.Tests/MySqlConnectionTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ public void AnonymousLogin()
514514
[Fact]
515515
public void ConnectInVariousWays()
516516
{
517-
// Fails in 8.0+ since new validation takes place were user does not exist.
517+
// Fails in 8.0+ since new validation takes place where user does not exist.
518518
if (st.conn.driver.Version.isAtLeast(8,0,1 )) return;
519519

520520
// connect with no db
@@ -1408,7 +1408,7 @@ public void ConnectUsingMySqlNativePasswordPlugin()
14081408
Assert.Contains("TLSv1", reader.GetString(1));
14091409
}
14101410

1411-
command.CommandText = String.Format("SELECT `User`, `plugin` FROM `mysql`.`user` WHERE `User` = '{0}';", userName);
1411+
command.CommandText = string.Format("SELECT `User`, `plugin` FROM `mysql`.`user` WHERE `User` = '{0}';", userName);
14121412
using (MySqlDataReader reader = command.ExecuteReader())
14131413
{
14141414
Assert.True(reader.Read());
@@ -1928,10 +1928,10 @@ public void EmptyPasswordOnMySqlNativePassword()
19281928
{
19291929
var pluginName = "mysql_native_password";
19301930
var builder = new MySqlConnectionStringBuilder();
1931-
builder.UserID = "testNativeBlankPassword";
1931+
builder.UserID = "testNtvPass";
19321932
builder.Password = "";
1933-
builder.Server = "localhost";
1934-
builder.Port = 3305;
1933+
builder.Server = st.conn.Settings.Server;
1934+
builder.Port = st.conn.Settings.Port;
19351935
st.CreateUser(builder.UserID, builder.Password, pluginName);
19361936

19371937
using (var connection = new MySqlConnection(builder.ConnectionString))

Tests/MySql.Data.Tests/PreparedStatementsPipe.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, 2018, 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
@@ -36,7 +36,7 @@ public class PreparedStatementsPipe : PreparedStatements
3636
{
3737
protected override string OnGetConnectionStringInfo()
3838
{
39-
return string.Format(";ignore prepare=false;protocol=pipe;pipe name={0};ssl mode=none;", st.pipeName);
39+
return string.Format(";ignore prepare=false;protocol=pipe;pipe name={0};ssl mode=none;allowpublickeyretrieval=true;", st.pipeName);
4040
}
4141
}
4242
}

0 commit comments

Comments
 (0)