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)); }
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); }
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); } }
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); }); }
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(); }
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(); }
static RemoteNotificationRequester() { CertificateValidationManager.RegisterCallback("RemoteNotification", new RemoteCertificateValidationCallback(RemoteNotificationRequester.SslCertificateValidationCallback)); }
// 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)); }
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)); }
static GlobalSettings() { CertificateValidationManager.RegisterCallback("AirSync", new RemoteCertificateValidationCallback(ProxyHandler.SslCertificateValidationCallback)); }