internal void ApplyTransportSecurity(HttpsRelayTransportBindingElement https)
 {
     if (this.mode == EndToEndSecurityMode.TransportWithMessageCredential || this.mode == EndToEndSecurityMode.Transport)
     {
         this.transportSecurity.ConfigureTransportProtectionOnly(https);
     }
 }
예제 #2
0
 internal void EnableTransportSecurity(HttpsRelayTransportBindingElement https)
 {
     if (this.mode == EndToEndBasicHttpSecurityMode.TransportWithMessageCredential)
     {
         this.transportSecurity.ConfigureTransportProtectionOnly(https);
         return;
     }
     this.transportSecurity.ConfigureTransportProtectionAndAuthentication(https);
 }
 private void Initialize()
 {
     this.httpRelayTransportBindingElement  = new HttpRelayTransportBindingElement();
     this.httpsRelayTransportBindingElement = new HttpsRelayTransportBindingElement();
     this.httpRelayTransportBindingElement.ManualAddressing  = true;
     this.httpsRelayTransportBindingElement.ManualAddressing = true;
     this.webMessageEncodingBindingElement = new WebMessageEncodingBindingElement()
     {
         MessageVersion = System.ServiceModel.Channels.MessageVersion.None
     };
 }
예제 #4
0
 private void Initialize()
 {
     this.httpTransport   = new HttpRelayTransportBindingElement();
     this.httpsTransport  = new HttpsRelayTransportBindingElement();
     this.messageEncoding = WSMessageEncoding.Text;
     this.textEncoding    = new TextMessageEncodingBindingElement()
     {
         MessageVersion = System.ServiceModel.Channels.MessageVersion.Soap11
     };
     this.mtomEncoding = new MtomMessageEncodingBindingElement()
     {
         MessageVersion = System.ServiceModel.Channels.MessageVersion.Soap11
     };
 }
예제 #5
0
        private void Initialize()
        {
            WSHttpBinding wSHttpBinding = new WSHttpBinding();

            this.httpTransport   = new HttpRelayTransportBindingElement();
            this.httpsTransport  = new HttpsRelayTransportBindingElement();
            this.messageEncoding = wSHttpBinding.MessageEncoding;
            this.session         = new System.ServiceModel.Channels.ReliableSessionBindingElement(true);
            this.textEncoding    = new TextMessageEncodingBindingElement()
            {
                MessageVersion = System.ServiceModel.Channels.MessageVersion.Soap12WSAddressing10
            };
            this.mtomEncoding = new MtomMessageEncodingBindingElement()
            {
                MessageVersion = System.ServiceModel.Channels.MessageVersion.Soap12WSAddressing10
            };
            this.reliableSession = new OptionalReliableSession(this.session);
        }
        internal static bool TryCreate(SecurityBindingElement sbe, Microsoft.ServiceBus.RelayClientAuthenticationType relayClientAuthenticationType, TransportBindingElement transport, System.ServiceModel.Channels.ReliableSessionBindingElement rsbe, out Binding binding)
        {
            Microsoft.ServiceBus.UnifiedSecurityMode unifiedSecurityMode;
            WSHttpRelaySecurity wSHttpRelaySecurity;
            bool flag;
            bool flag1 = rsbe != null;

            binding = null;
            HttpRelayTransportSecurity defaultHttpTransportSecurity = WSHttpRelaySecurity.GetDefaultHttpTransportSecurity();

            if (!WSHttpRelayBinding.GetSecurityModeFromTransport(transport, defaultHttpTransportSecurity, out unifiedSecurityMode))
            {
                return(false);
            }
            HttpsRelayTransportBindingElement httpsRelayTransportBindingElement = transport as HttpsRelayTransportBindingElement;

            if (httpsRelayTransportBindingElement != null && httpsRelayTransportBindingElement.MessageSecurityVersion != null && httpsRelayTransportBindingElement.MessageSecurityVersion.SecurityPolicyVersion != WS2007HttpRelayBinding.WS2007MessageSecurityVersion.SecurityPolicyVersion)
            {
                return(false);
            }
            if (WS2007HttpRelayBinding.TryCreateSecurity(sbe, unifiedSecurityMode, relayClientAuthenticationType, defaultHttpTransportSecurity, flag1, out wSHttpRelaySecurity))
            {
                WS2007HttpRelayBinding wS2007HttpRelayBinding = new WS2007HttpRelayBinding(wSHttpRelaySecurity, flag1);
                if (!WSHttpRelayBinding.TryGetAllowCookiesFromTransport(transport, out flag))
                {
                    return(false);
                }
                wS2007HttpRelayBinding.AllowCookies = flag;
                binding = wS2007HttpRelayBinding;
            }
            if (rsbe != null && rsbe.ReliableMessagingVersion != ReliableMessagingVersion.WSReliableMessaging11)
            {
                return(false);
            }
            return(binding != null);
        }
 internal static void ApplyTransportSecurity(HttpsRelayTransportBindingElement transport, HttpRelayTransportSecurity transportSecurity)
 {
     HttpRelayTransportSecurity.ConfigureTransportProtectionAndAuthentication(transport, transportSecurity);
 }
 internal void EnableTransportSecurity(HttpsRelayTransportBindingElement https)
 {
     this.transportSecurity.ConfigureTransportProtectionAndAuthentication(https);
 }
예제 #9
0
 internal void ConfigureTransportProtectionOnly(HttpsRelayTransportBindingElement https)
 {
     HttpRelayTransportSecurity.DisableAuthentication(https);
 }
예제 #10
0
 internal static void ConfigureTransportProtectionAndAuthentication(HttpsRelayTransportBindingElement https, HttpRelayTransportSecurity transportSecurity)
 {
     HttpRelayTransportSecurity.ConfigureAuthentication(https, transportSecurity);
 }
예제 #11
0
 internal void ConfigureTransportProtectionAndAuthentication(HttpsRelayTransportBindingElement https)
 {
     this.ConfigureAuthentication(https);
 }
 protected HttpsRelayTransportBindingElement(HttpsRelayTransportBindingElement elementToBeCloned) : base(elementToBeCloned)
 {
     this.messageSecurityVersion = elementToBeCloned.MessageSecurityVersion;
 }