summaryrefslogtreecommitdiff
path: root/csharp/test
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2019-11-04 18:50:14 +0100
committerBenoit Foucher <benoit@zeroc.com>2019-11-04 18:50:14 +0100
commit4885d2650328764cfc0ec000e52724f3f6c02205 (patch)
treecb9186f2aff6fbe3808c5a9470aa67329daad1d1 /csharp/test
parentMove response, error and sent functions given to the client Async API (#610) (diff)
downloadice-4885d2650328764cfc0ec000e52724f3f6c02205.tar.bz2
ice-4885d2650328764cfc0ec000e52724f3f6c02205.tar.xz
ice-4885d2650328764cfc0ec000e52724f3f6c02205.zip
Added testing of IceSSL/configuration test on macOS
Diffstat (limited to 'csharp/test')
-rw-r--r--csharp/test/IceSSL/configuration/AllTests.cs24
1 files changed, 22 insertions, 2 deletions
diff --git a/csharp/test/IceSSL/configuration/AllTests.cs b/csharp/test/IceSSL/configuration/AllTests.cs
index 8f5710df081..0c4b7b0a634 100644
--- a/csharp/test/IceSSL/configuration/AllTests.cs
+++ b/csharp/test/IceSSL/configuration/AllTests.cs
@@ -846,7 +846,17 @@ public class AllTests
X509Store certStore = new X509Store("My", StoreLocation.CurrentUser);
certStore.Open(OpenFlags.ReadWrite);
X509Certificate2Collection certs = new X509Certificate2Collection();
- certs.Import(defaultDir + "/s_rsa_cai2.p12", "password", X509KeyStorageFlags.DefaultKeySet);
+ var storageFlags = X509KeyStorageFlags.DefaultKeySet;
+ if(IceInternal.AssemblyUtil.isMacOS)
+ {
+ //
+ // On macOS, we need to mark the key exportable because the addition of the key to the
+ // cert store requires to move the key from on keychain to another (which requires the
+ // Exportable flag... see https://github.com/dotnet/corefx/issues/25631)
+ //
+ storageFlags |= X509KeyStorageFlags.Exportable;
+ }
+ certs.Import(defaultDir + "/s_rsa_cai2.p12", "password", storageFlags);
foreach(X509Certificate2 cert in certs)
{
certStore.Add(cert);
@@ -2313,11 +2323,21 @@ public class AllTests
X509Store certStore = new X509Store("My", StoreLocation.CurrentUser);
certStore.Open(OpenFlags.ReadWrite);
+ var storageFlags = X509KeyStorageFlags.DefaultKeySet;
+ if(IceInternal.AssemblyUtil.isMacOS)
+ {
+ //
+ // On macOS, we need to mark the key exportable because the addition of the key to the
+ // cert store requires to move the key from on keychain to another (which requires the
+ // Exportable flag... see https://github.com/dotnet/corefx/issues/25631)
+ //
+ storageFlags |= X509KeyStorageFlags.Exportable;
+ }
try
{
foreach(string cert in certificates)
{
- certStore.Add(new X509Certificate2(defaultDir + cert, "password"));
+ certStore.Add(new X509Certificate2(defaultDir + cert, "password", storageFlags));
}
for(int i = 0; i < clientFindCertProperties.Length; ++i)
{