Inheritance: CoreWCF.Channels.StreamUpgradeAcceptor
Exemplo n.º 1
0
            public static FramingConnectionDuplexSession CreateSession(FramingDuplexSessionChannel channel,
                                                                       StreamUpgradeAcceptor upgradeAcceptor)
            {
                StreamSecurityUpgradeAcceptor security = upgradeAcceptor as StreamSecurityUpgradeAcceptor;

                if (security == null)
                {
                    return(new FramingConnectionDuplexSession(channel));
                }
                else
                {
                    return(new SecureConnectionDuplexSession(channel));
                }
            }
Exemplo n.º 2
0
        void SetupSecurityIfNecessary(StreamUpgradeAcceptor upgradeAcceptor)
        {
            StreamSecurityUpgradeAcceptor securityUpgradeAcceptor = upgradeAcceptor as StreamSecurityUpgradeAcceptor;

            if (securityUpgradeAcceptor != null)
            {
                security = securityUpgradeAcceptor.GetRemoteSecurity();
                if (security == null)
                {
                    Exception securityFailedException = new ProtocolException(
                        SR.Format(SR.RemoteSecurityNotNegotiatedOnStreamUpgrade, Via));
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(securityFailedException);
                }
            }
        }
Exemplo n.º 3
0
            void WriteAuditFailure(StreamSecurityUpgradeAcceptor securityUpgradeAcceptor, Exception exception)
            {
                //try
                //{
                //    WriteAuditEvent(securityUpgradeAcceptor, AuditLevel.Failure, exception);
                //}
                //catch (Exception auditException)
                //{
                //    if (Fx.IsFatal(auditException))
                //    {
                //        throw;
                //    }

                //    DiagnosticUtility.TraceHandledException(auditException, TraceEventType.Error);
                //}
            }
Exemplo n.º 4
0
            void SetupSecurityIfNecessary()
            {
                StreamSecurityUpgradeAcceptor securityUpgradeAcceptor = upgradeAcceptor as StreamSecurityUpgradeAcceptor;

                if (securityUpgradeAcceptor != null)
                {
                    RemoteSecurity = securityUpgradeAcceptor.GetRemoteSecurity();

                    if (RemoteSecurity == null)
                    {
                        Exception securityFailedException = new ProtocolException(
                            SR.Format(SR.RemoteSecurityNotNegotiatedOnStreamUpgrade, Via));
                        WriteAuditFailure(securityUpgradeAcceptor, securityFailedException);
                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(securityFailedException);
                    }
                    else
                    {
                        // Audit Authentication Success
                        // WriteAuditEvent(securityUpgradeAcceptor, AuditLevel.Success, null);
                    }
                }
            }
Exemplo n.º 5
0
 void WriteAuditFailure(StreamSecurityUpgradeAcceptor securityUpgradeAcceptor, Exception exception)
 {
 }