Beispiel #1
0
        ITransportChannel CreateTransport(Socket socket, SecuritySettings securitySettings)
        {
            ITransportChannel transportChannel;

            if (securitySettings == null)
            {
                transportChannel = new SocketChannel(socket, SocketFlags.None, this.ConnectionName);
            }
            else
            {
                var x509Certificate    = securitySettings.X509Certificate;
                var validationCallback = securitySettings.ValidationCallback;
                transportChannel = new SslSocketChannel(socket, x509Certificate, validationCallback, this.ConnectionName);
            }
            return(transportChannel);
        }
Beispiel #2
0
        ITransportChannel CreateTransport(Socket socket, IPAddress ip, int port, SecuritySettings securitySettings)
        {
            ITransportChannel transportChannel;

            if (securitySettings == null)
            {
                transportChannel = new SocketChannel(socket, ip, port, SocketFlags.None, this.ConnectionName);
            }
            else
            {
                var certName           = securitySettings.CertificateName;
                var validationCallback = securitySettings.ValidationCallback;
                transportChannel = new SslSocketChannel(socket, ip, port, certName, validationCallback, this.ConnectionName);
            }
            return(transportChannel);
        }