Skip to content

Commit 29b1ac1

Browse files
Martin Bauliglewing
Martin Baulig
authored andcommitted
Fix the tests.
1 parent 71e34ed commit 29b1ac1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mcs/class/System/Mono.Btls/X509CertificateImplBtls.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,14 @@ public override AsymmetricAlgorithm PrivateKey {
198198
set {
199199
if (nativePrivateKey != null)
200200
nativePrivateKey.Dispose ();
201-
if (value == null) {
201+
try {
202+
// FIXME: there doesn't seem to be a public API to check whether it actually
203+
// contains a private key (apart from RSAManaged.PublicOnly).
204+
if (value != null)
205+
nativePrivateKey = MonoBtlsKey.CreateFromRSAPrivateKey ((RSA)value);
206+
} catch {
202207
nativePrivateKey = null;
203-
return;
204208
}
205-
nativePrivateKey = MonoBtlsKey.CreateFromRSAPrivateKey ((RSA)value);
206209
}
207210
}
208211

0 commit comments

Comments
 (0)