~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
using MonoDevelop.Core.Execution;
39
39
using MonoDevelop.Core.Instrumentation;
40
40
using MonoDevelop.Core.Setup;
 
41
using System.Security.Cryptography.X509Certificates;
 
42
using System.Net.Security;
 
43
using System.Net;
41
44
 
42
45
 
43
46
namespace MonoDevelop.Core
56
59
                                return;
57
60
                        Counters.RuntimeInitialization.BeginTiming ();
58
61
                        SetupInstrumentation ();
59
 
                        
60
 
                        if (Platform.IsMac)
61
 
                                InitMacFoundation ();
 
62
 
 
63
                        Platform.Initialize ();
62
64
                        
63
65
                        // Set a default sync context
64
66
                        if (SynchronizationContext.Current == null)
65
67
                                SynchronizationContext.SetSynchronizationContext (new SynchronizationContext ());
 
68
 
 
69
                        // Hook up the SSL certificate validation codepath
 
70
                        System.Net.ServicePointManager.ServerCertificateValidationCallback += delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) {
 
71
                                if (sslPolicyErrors == SslPolicyErrors.None)
 
72
                                        return true;
 
73
                                
 
74
                                if (sender is WebRequest)
 
75
                                        sender = ((WebRequest)sender).RequestUri.Host;
 
76
                                return WebCertificateService.GetIsCertificateTrusted (sender as string, certificate.GetPublicKeyString ());
 
77
                        };
66
78
                        
67
79
                        AddinManager.AddinLoadError += OnLoadError;
68
80
                        AddinManager.AddinLoaded += OnLoad;
171
183
                static void OnLoadError (object s, AddinErrorEventArgs args)
172
184
                {
173
185
                        string msg = "Add-in error (" + args.AddinId + "): " + args.Message;
 
186
                        LogReporting.LogReportingService.ReportUnhandledException (args.Exception, false, true);
174
187
                        LoggingService.LogError (msg, args.Exception);
175
188
                }
176
189
                
235
248
                
236
249
                public static void SetProcessName (string name)
237
250
                {
238
 
                        if (Environment.OSVersion.Platform == PlatformID.Unix) {
 
251
                        if (!Platform.IsMac && !Platform.IsWindows) {
239
252
                                try {
240
253
                                        unixSetProcessName (name);
241
254
                                } catch (Exception e) {
265
278
                        }
266
279
                }
267
280
                
268
 
                [DllImport ("libc")]
269
 
                extern static IntPtr dlopen (string name, int mode);
270
 
                
271
 
                static void InitMacFoundation ()
272
 
                {
273
 
                        dlopen ("/System/Library/Frameworks/Foundation.framework/Foundation", 0x1);
274
 
                }
275
 
                
276
281
                public static event EventHandler ShuttingDown;
277
282
        }
278
283