From 662d25330343991262331b1154dcf91b944ac957 Mon Sep 17 00:00:00 2001 From: Jonathan Haines Date: Mon, 23 Mar 2015 18:26:43 +1100 Subject: [PATCH] Remove usage of ServicePointManager.ServerCertificateValidationCallback on Windows --- SparkleShare/SparkleAvatars.cs | 3 +++ SparkleShare/SparkleInvite.cs | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/SparkleShare/SparkleAvatars.cs b/SparkleShare/SparkleAvatars.cs index b4ff65b5..b735bc51 100644 --- a/SparkleShare/SparkleAvatars.cs +++ b/SparkleShare/SparkleAvatars.cs @@ -34,7 +34,10 @@ namespace SparkleShare public static string GetAvatar (string email, int size, string target_path) { + #if __MonoCS__ ServicePointManager.ServerCertificateValidationCallback = GetAvatarValidationCallBack; + #endif + email = email.ToLower (); if (skipped_avatars.Contains (email)) diff --git a/SparkleShare/SparkleInvite.cs b/SparkleShare/SparkleInvite.cs index e4bbcafa..7ce67eb9 100644 --- a/SparkleShare/SparkleInvite.cs +++ b/SparkleShare/SparkleInvite.cs @@ -60,7 +60,11 @@ namespace SparkleShare { public bool Accept (string public_key) { - ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; + #if __MonoCS__ + ServicePointManager.ServerCertificateValidationCallback = delegate { + return true; + }; + #endif if (string.IsNullOrEmpty (AcceptUrl)) return true;