Example #1
0
 protected override TransportBindingElement GetTransport()
 {
     if (_security.Mode == SecurityMode.None || _security.Mode == SecurityMode.Message)
     {
         HttpTransport.ExtendedProtectionPolicy = _security.Transport.ExtendedProtectionPolicy;
         return(HttpTransport);
     }
     else
     {
         _security.ApplyTransportSecurity(HttpsTransport);
         return(HttpsTransport);
     }
 }
Example #2
0
 internal static bool GetSecurityModeFromTransport(TransportBindingElement transport, HttpTransportSecurity transportSecurity, out UnifiedSecurityMode mode)
 {
     mode = UnifiedSecurityMode.None;
     if (transport is HttpsTransportBindingElement)
     {
         mode = UnifiedSecurityMode.Transport | UnifiedSecurityMode.TransportWithMessageCredential;
         WSHttpSecurity.ApplyTransportSecurity((HttpsTransportBindingElement)transport, transportSecurity);
     }
     else if (transport is HttpTransportBindingElement)
     {
         mode = UnifiedSecurityMode.None | UnifiedSecurityMode.Message;
     }
     else
     {
         return(false);
     }
     return(true);
 }