Ejemplo n.º 1
0
            protected override Binding CreateBinding(Uri address)
            {
                WebHttpBinding webHttpBinding = new WebHttpBinding(address.Scheme);

                if (VirtualDirectoryConfiguration.IsClientCertificateRequired(address))
                {
                    webHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
                }
                return(webHttpBinding);
            }
Ejemplo n.º 2
0
        internal static Uri GetFailBackUrl(EcpService ecpService)
        {
            Uri uri = null;

            if (VirtualDirectoryConfiguration.failbackUrlCache.TryGetValue(ecpService.MetabasePath, out uri))
            {
                return(uri);
            }
            string webSiteRoot = IisUtility.GetWebSiteRoot(ecpService.MetabasePath);

            foreach (ADOwaVirtualDirectory adowaVirtualDirectory in VirtualDirectoryConfiguration.FindVirtualDirectoriesForServer <ADOwaVirtualDirectory>(ecpService.ServerFullyQualifiedDomainName))
            {
                if (webSiteRoot.Equals(IisUtility.GetWebSiteRoot(adowaVirtualDirectory.MetabasePath), StringComparison.OrdinalIgnoreCase) && adowaVirtualDirectory.FailbackUrl != null)
                {
                    uri = new UriBuilder(adowaVirtualDirectory.FailbackUrl)
                    {
                        Path  = ecpService.Url.AbsolutePath,
                        Query = ecpService.Url.Query
                    }.Uri;
                }
            }
            VirtualDirectoryConfiguration.failbackUrlCache[ecpService.MetabasePath] = uri;
            return(uri);
        }
Ejemplo n.º 3
0
 public static bool IsClientCertificateRequired(Uri address)
 {
     return((VirtualDirectoryConfiguration.LoadAccessSslFlags(address.LocalPath) & MetabasePropertyTypes.AccessSSLFlags.AccessSSLRequireCert) != MetabasePropertyTypes.AccessSSLFlags.None);
 }
Ejemplo n.º 4
0
        private void Application_Start(object sender, EventArgs e)
        {
            EcpEventLogConstants.Tuple_EcpStarted.LogEvent(new object[]
            {
                AppDomain.CurrentDomain.FriendlyName
            });
            if (!Util.IsDataCenter)
            {
                ServiceDiscovery.ADNotificationScope = ExchangeTopologyScope.ADAndExchangeServerAndSiteAndVirtualDirectoryTopology;
            }
            Globals.InitializeMultiPerfCounterInstance("ECP");
            foreach (ExPerformanceCounter exPerformanceCounter in EcpPerfCounters.AllCounters)
            {
                exPerformanceCounter.RawValue = 0L;
            }
            using (Process currentProcess = Process.GetCurrentProcess())
            {
                EcpPerfCounters.PID.RawValue = (long)currentProcess.Id;
            }
            ADSession.DisableAdminTopologyMode();
            BaseSprite.IsDataCenter      = Util.IsMicrosoftHostedOnly;
            BaseSprite.GetSpriteImageSrc = new GetSpriteImageSrcDelegate(Util.GetSpriteImageSrc);
            VirtualDirectoryConfiguration.EcpVirtualDirectoryAnonymousAuthenticationEnabled = VirtualDirectoryConfiguration.GetEcpAnonymousAuthenticationStatus();
            string identification = ConfigurationManager.AppSettings["ProvisioningCacheIdentification"];

            ProvisioningCache.InitializeAppRegistrySettings(identification);
            this.InvokeExtendedApplicationStart(sender, e);
            ScriptManager.ScriptResourceMapping.AddDefinition("MicrosoftAjax.js", new ScriptResourceDefinition
            {
                Path      = ThemeResource.ScriptPath + "microsoftajax.js",
                DebugPath = ThemeResource.ScriptPath + "microsoftajax.debug.js"
            });
        }