Skip to content

Commit

Permalink
Use SSL certificates with password for workaround Ice bug (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone authored Feb 20, 2024
1 parent fda69a3 commit e6b3603
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Binary file modified certs/cacert.der
Binary file not shown.
Binary file modified certs/client.p12
Binary file not shown.
Binary file modified certs/server.p12
Binary file not shown.
10 changes: 6 additions & 4 deletions tests/Interop.Tests/SslTransportTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public async Task Create_ssl_connection_from_Ice_to_IceRPC()
{
// Arrange
using var caCertificate = new X509Certificate2("cacert.der");
using var serverCertificate = new X509Certificate2("server.p12");
using var clientCertificate = new X509Certificate2("client.p12");
using var serverCertificate = new X509Certificate2("server.p12", "password");
using var clientCertificate = new X509Certificate2("client.p12", "password");
X509Certificate2? peerCertificate = null;
await using var server = new Server(
new InlineDispatcher((request, cancellationToken) => throw new NotImplementedException()),
Expand All @@ -41,6 +41,7 @@ public async Task Create_ssl_connection_from_Ice_to_IceRPC()
"--Ice.Plugin.IceSSL=IceSSL:IceSSL.PluginFactory",
"--IceSSL.CertFile=client.p12",
"--IceSSL.CAs=cacert.der",
"--IceSSL.Password=password"
};
using Communicator communicator = Util.initialize(ref args);
ObjectPrx proxy = communicator.CreateObjectPrx("hello", serverAddress with { Transport = "ssl" });
Expand Down Expand Up @@ -68,6 +69,7 @@ public async Task Create_ssl_connection_from_IceRPC_to_Ice()
"--Ice.Plugin.IceSSL=IceSSL:IceSSL.PluginFactory",
"--IceSSL.CertFile=server.p12",
"--IceSSL.CAs=cacert.der",
"--IceSSL.Password=password"
};

using Communicator communicator = Util.initialize(ref args);
Expand All @@ -78,8 +80,8 @@ public async Task Create_ssl_connection_from_IceRPC_to_Ice()
adapter.activate();

using var caCertificate = new X509Certificate2("cacert.der");
using var serverCertificate = new X509Certificate2("server.p12");
using var clientCertificate = new X509Certificate2("client.p12");
using var serverCertificate = new X509Certificate2("server.p12", "password");
using var clientCertificate = new X509Certificate2("client.p12", "password");
X509Certificate2? peerCertificate = null;
await using var clientConnection = new ClientConnection(
adapter.GetFirstServerAddress(),
Expand Down

0 comments on commit e6b3603

Please sign in to comment.