Skip to content

Commit

Permalink
Use passwordless certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Sep 23, 2024
1 parent 0342605 commit 0058a39
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 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.
20 changes: 10 additions & 10 deletions tests/Interop.Tests/SslTransportTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ public async Task Create_ssl_connection_from_Ice_to_IceRPC()

using var serverCertificate = X509CertificateLoader.LoadPkcs12FromFile(
"server.p12",
"password",
keyStorageFlags: X509KeyStorageFlags.Exportable);
password: null,
keyStorageFlags: X509KeyStorageFlags.Exportable);

using var clientCertificate = X509CertificateLoader.LoadPkcs12FromFile(
"client.p12",
"password",
keyStorageFlags: X509KeyStorageFlags.Exportable);
password: null,
keyStorageFlags: X509KeyStorageFlags.Exportable);

X509Certificate2? validatedClientCertificate = null;
X509Certificate2? validatedServerCertificate = null;
Expand Down Expand Up @@ -53,7 +53,7 @@ public async Task Create_ssl_connection_from_Ice_to_IceRPC()
initData.properties = new Properties();
initData.clientAuthenticationOptions = new SslClientAuthenticationOptions
{
ClientCertificates = new X509CertificateCollection { clientCertificate },
ClientCertificates = [clientCertificate],
RemoteCertificateValidationCallback =
(sender, certificate, chain, errors) =>
{
Expand Down Expand Up @@ -81,13 +81,13 @@ public async Task Create_ssl_connection_from_IceRPC_to_Ice()

using var serverCertificate = X509CertificateLoader.LoadPkcs12FromFile(
"server.p12",
"password",
keyStorageFlags: X509KeyStorageFlags.Exportable);
password: null,
keyStorageFlags: X509KeyStorageFlags.Exportable);

using var clientCertificate = X509CertificateLoader.LoadPkcs12FromFile(
"client.p12",
"password",
keyStorageFlags: X509KeyStorageFlags.Exportable);
password: null,
keyStorageFlags: X509KeyStorageFlags.Exportable);

X509Certificate2? validatedClientCertificate = null;
X509Certificate2? validatedServerCertificate = null;
Expand Down Expand Up @@ -117,7 +117,7 @@ public async Task Create_ssl_connection_from_IceRPC_to_Ice()
adapter.GetFirstServerAddress(),
clientAuthenticationOptions: new SslClientAuthenticationOptions
{
ClientCertificates = new X509CertificateCollection { clientCertificate },
ClientCertificates = [clientCertificate],
RemoteCertificateValidationCallback =
(sender, certificate, chain, errors) =>
{
Expand Down

0 comments on commit 0058a39

Please sign in to comment.