9func TestStarttls(t *testing.T) {
11 tc.client.Starttls(&tls.Config{InsecureSkipVerify: true})
12 tc.transactf("bad", "starttls") // TLS already active.
13 tc.client.Login("mjl@mox.example", password0)
16 tc = startArgs(t, true, true, false, true, "mjl")
17 tc.transactf("bad", "starttls") // TLS already active.
20 tc = startArgs(t, true, false, false, true, "mjl")
21 tc.transactf("no", `login "mjl@mox.example" "%s"`, password0)
22 tc.xcode("PRIVACYREQUIRED")
23 tc.transactf("no", "authenticate PLAIN %s", base64.StdEncoding.EncodeToString([]byte("\u0000mjl@mox.example\u0000"+password0)))
24 tc.xcode("PRIVACYREQUIRED")
25 tc.client.Starttls(&tls.Config{InsecureSkipVerify: true})
26 tc.client.Login("mjl@mox.example", password0)