Пример #1
0
 public TunnelListener(string endpoint, int port, TunnelSender target, string certificate, string password, params ExpectedCertificate[] accept)
     : base(certificate, password, accept)
 {
     IpEndpoint = endpoint;
     Port       = port;
     Target     = target;
 }
Пример #2
0
 public TunnelMultiplexer(string endpoint, int[] ports, TunnelSender target, string certificate, string password, params ExpectedCertificate[] accept)
     : base(certificate, password, accept)
 {
     IpEndpoint = endpoint;
     Ports      = new AddPort[ports.Length];
     for (int i = 0; i < ports.Length; i++)
     {
         Ports[i] = new AddPort(ports[i]);
     }
     Target = target;
 }
        private TcpClient MakeSender(TunnelSender target)
        {
            TcpClient client = null;

            if (!target.UseSsl)
            {
                client = new TcpClient(target.IpEndpoint, target.Port);
            }
            else
            {
                X509Certificate cert = null;
                if (!String.IsNullOrEmpty(target.ClientCertificate))
                {
                    cert = new X509Certificate(target.ClientCertificate, target.ClientCertPassword);
                }

                client = new SslClient(target.IpEndpoint, target.Port, cert, target.ExpectedCert);
            }
            return(client);
        }
Пример #4
0
 public TunnelMultiplexer(string endpoint, int[] ports, TunnelSender target)
     : this(endpoint, ports, target, null, null, new ExpectedCertificate[0])
 {
 }
Пример #5
0
 public TunnelListener(string endpoint, int port, TunnelSender target)
     : this(endpoint, port, target, null, null, new ExpectedCertificate[0])
 {
 }