You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2021/11/15 07:04:43 UTC
[ignite] branch gg-34169 updated: wip TestSslConnectionWithClientAuth, TestSslConnectionWithoutClientAuth
This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch gg-34169
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/gg-34169 by this push:
new e58695c wip TestSslConnectionWithClientAuth, TestSslConnectionWithoutClientAuth
e58695c is described below
commit e58695cf0af80833d663c741b4308b83d2f804c9
Author: Pavel Tupitsyn <pt...@apache.org>
AuthorDate: Mon Nov 15 10:04:23 2021 +0300
wip TestSslConnectionWithClientAuth, TestSslConnectionWithoutClientAuth
---
.../Client/ClientConnectionTest.cs | 61 ++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs
index 5a0311c..68bbaf9 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs
@@ -21,6 +21,7 @@ namespace Apache.Ignite.Core.Tests.Client
using System.Linq;
using System.Net;
using System.Net.Sockets;
+ using System.Security.Authentication;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
@@ -654,6 +655,66 @@ namespace Apache.Ignite.Core.Tests.Client
}
/// <summary>
+ /// Tests SSL connection with client-side SSL certificate.
+ /// </summary>
+ [Test]
+ public void TestSslConnectionWithClientAuth()
+ {
+ Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration())
+ {
+ SpringConfigUrl = Path.Combine("Config", "Client", "server-with-ssl.xml")
+ });
+
+ var cfg = new IgniteClientConfiguration
+ {
+ Endpoints = new[] { "127.0.0.1:11110" },
+ SslStreamFactory = new SslStreamFactory
+ {
+ CertificatePath = Path.Combine("Config", "Client", "thin-client-cert.pfx"),
+ CertificatePassword = "123456",
+ SkipServerCertificateValidation = true,
+ CheckCertificateRevocation = true,
+#if !NETCOREAPP
+ SslProtocols = SslProtocols.Tls
+#else
+ SslProtocols = SslProtocols.Tls12
+#endif
+ }
+ };
+
+ using (var client = Ignition.StartClient(cfg))
+ {
+ Assert.AreEqual(1, client.GetCluster().GetNodes().Count);
+ }
+ }
+
+ /// <summary>
+ /// Tests SSL connection without client-side SSL certificate.
+ /// </summary>
+ [Test]
+ public void TestSslConnectionWithoutClientAuth()
+ {
+ Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration())
+ {
+ SpringConfigUrl = Path.Combine("Config", "Client", "server-with-ssl-no-client-auth.xml"),
+ });
+
+ var cfg = new IgniteClientConfiguration
+ {
+ Endpoints = new[] { "127.0.0.1:11120" },
+ SslStreamFactory = new SslStreamFactory
+ {
+ SkipServerCertificateValidation = true
+ }
+ };
+
+ using (var client = Ignition.StartClient(cfg))
+ {
+ Assert.AreEqual(1, client.GetCluster().GetNodes().Count);
+ }
+ }
+
+ /// <summary>
/// Starts the client.
/// </summary>
private static IIgniteClient StartClient()