示例#1
0
 private void Application_Start(object sender, EventArgs e)
 {
     Diagnostics.InitializeWatsonReporting();
     if (Globals.InstanceType == InstanceType.NotInitialized)
     {
         string text = HttpProxyGlobals.ProtocolType.ToString();
         text = "FE_" + text;
         Globals.InitializeMultiPerfCounterInstance(text);
     }
     Diagnostics.SendWatsonReportOnUnhandledException(delegate()
     {
         Task.Factory.StartNew(delegate()
         {
             SettingOverrideSync.Instance.Start(true);
         });
         CertificateValidationManager.RegisterCallback(Constants.CertificateValidationComponentId, ProxyApplication.RemoteCertificateValidationCallback);
         ProxyApplication.ConfigureServicePointManager();
         if (DownLevelServerManager.IsApplicable)
         {
             DownLevelServerManager.Instance.Initialize();
         }
     });
     PerfCounters.UpdateHttpProxyPerArrayCounters();
     Diagnostics.Logger.LogEvent(FrontEndHttpProxyEventLogConstants.Tuple_ApplicationStart, null, new object[]
     {
         HttpProxyGlobals.ProtocolType
     });
 }
 internal AutoDiscoverRequest(Application application, ClientContext clientContext, RequestLogger requestLogger, Uri targetUri, EmailAddress emailAddress, ICredentials credentialsForDiscovery, UriSource uriSource) : base(application, clientContext, requestLogger, "AutoDiscoverRequest")
 {
     this.uriSource               = uriSource;
     this.emailAddress            = emailAddress;
     this.credentialsForDiscovery = credentialsForDiscovery;
     this.targetUri               = targetUri;
     CertificateValidationManager.RegisterCallback(Globals.CertificateValidationComponentId, new RemoteCertificateValidationCallback(CertificateErrorHandler.CertValidationCallback));
 }
示例#3
0
 internal RestService(HttpAuthenticator authenticator, WebServiceUri webServiceUri, bool traceRequest, ITracer upstreamTracer)
 {
     this.authenticator = authenticator;
     this.componentId   = Globals.CertificateValidationComponentId;
     this.httpHeaders   = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
     this.traceRequest  = traceRequest;
     this.tracer        = upstreamTracer;
     this.targetUri     = webServiceUri.Uri;
     CertificateValidationManager.RegisterCallback(this.componentId, new RemoteCertificateValidationCallback(CertificateErrorHandler.CertValidationCallback));
 }
        private static ExchangeService CreateExchangeService(string domain, EncryptionConfigurationTable.RequestData requestData)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            ADUser orgMailbox = EncryptionConfigurationTable.GetOrgMailbox(domain);

            requestData.OrgMailboxAdUserLookupTime = stopwatch.ElapsedMilliseconds;
            if (orgMailbox == null)
            {
                return(null);
            }
            ExchangePrincipal exchangePrincipal;

            try
            {
                exchangePrincipal = ExchangePrincipal.FromADUser(orgMailbox, null);
            }
            catch (ObjectNotFoundException exception)
            {
                EncryptionConfigurationTable.logger.LogEvent(ApplicationLogicEventLogConstants.Tuple_E4EOrganizationMailboxWebServiceUrlRetrievalFailed, domain, new object[]
                {
                    "ProcessEncryptionConfiguration",
                    EncryptionConfigurationTable.GetLoggedExceptionString(exception)
                });
                return(null);
            }
            Uri backEndWebServicesUrl;

            try
            {
                backEndWebServicesUrl = BackEndLocator.GetBackEndWebServicesUrl(exchangePrincipal.MailboxInfo);
                stopwatch.Stop();
                requestData.WebServiceUrlLookupTime = stopwatch.ElapsedMilliseconds - requestData.OrgMailboxAdUserLookupTime;
            }
            catch (BackEndLocatorException exception2)
            {
                EncryptionConfigurationTable.logger.LogEvent(ApplicationLogicEventLogConstants.Tuple_E4EOrganizationMailboxWebServiceUrlRetrievalFailed, domain, new object[]
                {
                    "ProcessEncryptionConfiguration",
                    EncryptionConfigurationTable.GetLoggedExceptionString(exception2)
                });
                return(null);
            }
            ExchangeService exchangeService = new ExchangeService(4);

            exchangeService.Url = backEndWebServicesUrl;
            exchangeService.PrivilegedUserId            = new PrivilegedUserId(0, 2, orgMailbox.PrimarySmtpAddress.ToString());
            exchangeService.PrivilegedUserId.BudgetType = new PrivilegedUserIdBudgetType?(2);
            RemoteCertificateValidationCallback callback = (object param0, X509Certificate param1, X509Chain param2, SslPolicyErrors param3) => true;

            CertificateValidationManager.RegisterCallback("E4E.EncryptionConfigurationTable", callback);
            exchangeService.HttpHeaders.Add(CertificateValidationManager.ComponentIdHeaderName, "E4E.EncryptionConfigurationTable");
            return(exchangeService);
        }
示例#5
0
 protected virtual void FillRequestProperties(HttpWebRequest request)
 {
     request.ContentType     = "text/xml;charset=utf-8";
     request.UserAgent       = this.UserAgent;
     request.PreAuthenticate = true;
     request.CookieContainer = new CookieContainer();
     if (this.IgnoreSslCertError)
     {
         CertificateValidationManager.RegisterCallback(ServiceValidatorBase.ComponentId, new RemoteCertificateValidationCallback(ServiceValidatorBase.TrustAllCertValidationCallback));
         CertificateValidationManager.SetComponentId(request, ServiceValidatorBase.ComponentId);
     }
 }
示例#6
0
 static AutodiscoverProxy()
 {
     CertificateValidationManager.RegisterCallback("AutodiscoverProxy", delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
     {
         if (!(sender is HttpWebRequest))
         {
             return(false);
         }
         HttpWebRequest httpWebRequest = (HttpWebRequest)sender;
         Common.EventLog.LogEvent(AutodiscoverEventLogConstants.Tuple_ErrProviderRedirectServerCertificate, Common.PeriodicKey, new object[]
         {
             (httpWebRequest.RequestUri != null) ? httpWebRequest.RequestUri.Host : "Unknown Host",
             (certificate == null) ? "No Certificate" : certificate.Subject,
             sslPolicyErrors
         });
         return(SslConfiguration.AllowExternalUntrustedCerts);
     });
 }
示例#7
0
 public NonIndexableDiscoveryEwsClient(GroupId groupId, MailboxInfo[] mailboxes, ExTimeZone timeZone, CallerInfo caller)
 {
     Util.ThrowOnNull(groupId, "groupId");
     Util.ThrowOnNull(mailboxes, "mailboxes");
     Util.ThrowOnNull(timeZone, "timeZone");
     Util.ThrowOnNull(caller, "caller");
     this.groupId    = groupId;
     this.mailboxes  = mailboxes;
     this.callerInfo = caller;
     CertificateValidationManager.RegisterCallback(base.GetType().FullName, new RemoteCertificateValidationCallback(CertificateValidation.CertificateErrorHandler));
     this.service     = new ExchangeService(4, NonIndexableDiscoveryEwsClient.GetTimeZoneInfoFromExTimeZone(timeZone));
     this.service.Url = this.groupId.Uri;
     this.service.HttpHeaders[CertificateValidationManager.ComponentIdHeaderName] = base.GetType().FullName;
     if (this.groupId.GroupType != GroupType.CrossPremise)
     {
         this.service.UserAgent = WellKnownUserAgent.GetEwsNegoAuthUserAgent(base.GetType().FullName);
     }
     this.service.ClientRequestId = this.callerInfo.QueryCorrelationId.ToString("N");
     this.Authenticate();
 }
示例#8
0
        public DiscoveryEwsClient(GroupId groupId, MailboxInfo[] mailboxes, SearchCriteria searchCriteria, PagingInfo pagingInfo, CallerInfo caller)
        {
            this.groupId        = groupId;
            this.mailboxes      = mailboxes;
            this.searchCriteria = searchCriteria;
            this.pagingInfo     = pagingInfo;
            this.callerInfo     = caller;
            CertificateValidationManager.RegisterCallback(base.GetType().FullName, new RemoteCertificateValidationCallback(CertificateValidation.CertificateErrorHandler));
            this.service     = new ExchangeService(4, DiscoveryEwsClient.GetTimeZoneInfoFromExTimeZone(this.pagingInfo.TimeZone));
            this.service.Url = this.groupId.Uri;
            this.service.HttpHeaders[CertificateValidationManager.ComponentIdHeaderName] = base.GetType().FullName;
            string text = string.Format("{0}&FOUT=true", caller.UserAgent);

            if (this.groupId.GroupType != GroupType.CrossPremise)
            {
                this.service.UserAgent = WellKnownUserAgent.GetEwsNegoAuthUserAgent(string.Format("{0}-{1}", DiscoveryEwsClient.CrossServerUserAgent, text));
            }
            else
            {
                this.service.UserAgent = text;
            }
            this.service.ClientRequestId = this.callerInfo.QueryCorrelationId.ToString("N");
            this.Authenticate();
        }
示例#9
0
 static RemoteNotificationRequester()
 {
     CertificateValidationManager.RegisterCallback("RemoteNotification", new RemoteCertificateValidationCallback(RemoteNotificationRequester.SslCertificateValidationCallback));
 }
示例#10
0
 // Token: 0x060011E4 RID: 4580 RVA: 0x0006C1A8 File Offset: 0x0006A3A8
 public static void Initialize()
 {
     CertificateValidationManager.RegisterCallback("OWA", new RemoteCertificateValidationCallback(ProxyEventHandler.SslCertificateValidationCallback));
     CertificateValidationManager.RegisterCallback("OWA_IgnoreCertErrors", new RemoteCertificateValidationCallback(ProxyEventHandler.SslCertificateIgnoreCallback));
     ServicePointManager.DefaultConnectionLimit = Globals.ServicePointConnectionLimit;
 }
 // Token: 0x06001A9F RID: 6815 RVA: 0x00063D84 File Offset: 0x00061F84
 static GetPersonaPhoto()
 {
     CertificateValidationManager.RegisterCallback("GetPersonaPhoto", new RemoteCertificateValidationCallback(CommonCertificateValidationCallbacks.InternalServerToServer));
 }
示例#12
0
 static CommandInvocation()
 {
     CertificateValidationManager.RegisterCallback("CommandInvcocation", new RemoteCertificateValidationCallback(CommandInvocation.CertificateNoValidationCallback));
 }
 static AuthMetadataClient()
 {
     CertificateValidationManager.RegisterCallback("Microsoft.Exchange.Data.Directory.SystemConfiguration.AuthMetadataClient.NoSsl", new RemoteCertificateValidationCallback(AuthMetadataClient.ServerCertificateValidatorIgnoreSslErrors));
     CertificateValidationManager.RegisterCallback("Microsoft.Exchange.Data.Directory.SystemConfiguration.AuthMetadataClient", new RemoteCertificateValidationCallback(AuthMetadataClient.ServerCertificateValidator));
 }
示例#14
0
 static GlobalSettings()
 {
     CertificateValidationManager.RegisterCallback("AirSync", new RemoteCertificateValidationCallback(ProxyHandler.SslCertificateValidationCallback));
 }