Ejemplo n.º 1
0
        public void StlsCommandShouldSwithToTls()
        {
            var imapSimulator = new ImapClientSimulator(false, 14302);

            imapSimulator.Connect();
            var data = imapSimulator.GetCapabilities();

            imapSimulator.SendSingleCommand("A01 STARTTLS");
            imapSimulator.Handshake();

            // command is sent over TLS.
            imapSimulator.GetCapabilities();

            imapSimulator.Logon(_account.Address, "test");
        }
Ejemplo n.º 2
0
        public void IfStartTlsIsEnabledStartTlsShouldBeShownInEhloResponse()
        {
            var imapSimulator = new ImapClientSimulator(false, 14302);

            imapSimulator.Connect();
            var data = imapSimulator.GetCapabilities();

            Assert.IsTrue(data.Contains("STARTTLS"));
        }
Ejemplo n.º 3
0
        public void IfStlsRequiredLogonShouldSucceedIfStls()
        {
            var imapSimulator = new ImapClientSimulator(false, 14303);

            imapSimulator.Connect();
            imapSimulator.SendSingleCommand("A01 STARTTLS");
            imapSimulator.Handshake();

            // command is sent over TLS.
            imapSimulator.GetCapabilities();

            Assert.IsTrue(imapSimulator.Logon(_account.Address, "test"));
        }