internal static RemoteCertValidationCallback MonoToInternal(MSI.MonoRemoteCertificateValidationCallback callback)
        {
            if (callback == null)
            {
                return(null);
            }

            return((h, c, ch, e) => callback(h, c, ch, (MSI.MonoSslPolicyErrors)e));
        }
Exemple #2
0
        internal static RemoteCertificateValidationCallback MonoToPublic(MSI.MonoRemoteCertificateValidationCallback callback)
        {
            if (callback == null)
            {
                return(null);
            }

            return((t, c, ch, e) => callback(null, c, (XX509Chain)(object)ch, (MSI.MonoSslPolicyErrors)e));
        }
Exemple #3
0
 internal IMonoSslStream CreateSslStream(Stream innerStream, bool ownsStream, MSI.MonoRemoteCertificateValidationCallback callback)
 {
     lock (registry) {
         if (tlsProvider == null)
         {
             tlsProvider = MonoTlsProviderFactory.GetProviderInternal();
         }
         if (tlsSettings == null)
         {
             tlsSettings = MSI.MonoTlsSettings.CopyDefaultSettings();
         }
         if (tlsSettings.RemoteCertificateValidationCallback == null)
         {
             tlsSettings.RemoteCertificateValidationCallback = callback;
         }
         return(tlsProvider.CreateSslStream(innerStream, ownsStream, tlsSettings));
     }
 }