Ejemplo n.º 1
0
        public void IfStlsRequiredLogonShouldFailIfNoStls()
        {
            var pop3Simulator = new POP3ClientSimulator(false, 11003);
             pop3Simulator.Connect();
             string banner;
             pop3Simulator.ReceiveBanner(out banner);

             // run over TLS.
             var result = pop3Simulator.User("*****@*****.**");
             CustomAssert.IsTrue(result.StartsWith("-ERR STLS is required."));
        }
Ejemplo n.º 2
0
        public void IfStartTlsNotEnabledStartTlsShouldNotBeShownInEhloResponse()
        {
            var pop3Simulator = new POP3ClientSimulator(false, 110);
             pop3Simulator.Connect();
             string banner;

             pop3Simulator.ReceiveBanner(out banner);

             var data = pop3Simulator.CAPA();

             CustomAssert.IsFalse(data.Contains("STLS"));
        }
Ejemplo n.º 3
0
        public void IfStlsOptionalButSslRequiredByIpRangeForAuthThenAuthShouldFail()
        {
            var range = SingletonProvider<TestSetup>.Instance.GetApp().Settings.SecurityRanges.get_ItemByName("My computer");
             range.RequireSSLTLSForAuth = true;
             range.Save();

             var pop3Simulator = new POP3ClientSimulator(false, 11002);
             pop3Simulator.Connect();
             string banner;
             pop3Simulator.ReceiveBanner(out banner);

             // run over TLS.
             var result = pop3Simulator.User("*****@*****.**");
             CustomAssert.IsTrue(result.StartsWith("-ERR A SSL/TLS-connection is required for authentication."));
        }
Ejemplo n.º 4
0
        public void IfStlsRequiredLogonShouldSucceedIfStls()
        {
            var pop3Simulator = new POP3ClientSimulator(false, 11003);
             pop3Simulator.Connect();
             string banner;
             pop3Simulator.ReceiveBanner(out banner);
             pop3Simulator.STLS();
             pop3Simulator.Handshake();

             // run over TLS.
             var result = pop3Simulator.User("*****@*****.**");
             CustomAssert.IsTrue(result.StartsWith("+OK"));
        }
Ejemplo n.º 5
0
        public void StlsCommandShouldSwithToTls()
        {
            var pop3Simulator = new POP3ClientSimulator(false, 11002);
             pop3Simulator.Connect();
             string banner;
             pop3Simulator.ReceiveBanner(out banner);
             pop3Simulator.STLS();
             pop3Simulator.Handshake();

             // run over TLS.
             pop3Simulator.HELP();
        }