From 684cd289cbc1cd88236688127c8a76a823d248b3 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Thu, 23 Aug 2012 10:47:37 -0400 Subject: [PATCH] Fix binding (type) and value error (true) that could lead to error #5 (kSecTrustResultRecoverableTrustFailure) for valid certificates. Fix bug #4001 --- .../OSX509Certificates.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs index 905d6324474..3a1e6b90f9b 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs @@ -1,4 +1,5 @@ // Copyright (C) 2010 Novell, Inc (http://www.novell.com) +// Copyright 2012 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -38,7 +39,7 @@ namespace Mono.Security.X509 { extern static int SecTrustCreateWithCertificates (IntPtr certOrCertArray, IntPtr policies, out IntPtr sectrustref); [DllImport (SecurityLibrary)] - extern static IntPtr SecPolicyCreateSSL (int server, IntPtr cfStringHostname); + extern static IntPtr SecPolicyCreateSSL (bool server, IntPtr cfStringHostname); [DllImport (SecurityLibrary)] extern static int SecTrustEvaluate (IntPtr secTrustRef, out SecTrustResult secTrustResultTime); @@ -63,7 +64,7 @@ namespace Mono.Security.X509 { ResultOtherError, } - static IntPtr sslsecpolicy = SecPolicyCreateSSL (0, IntPtr.Zero); + static IntPtr sslsecpolicy = SecPolicyCreateSSL (true, IntPtr.Zero); static IntPtr MakeCFData (byte [] data) { -- 2.25.1