Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement STARTTLS #31

Open
ivucica opened this issue Jan 16, 2016 · 0 comments
Open

Implement STARTTLS #31

ivucica opened this issue Jan 16, 2016 · 0 comments

Comments

@ivucica
Copy link

ivucica commented Jan 16, 2016

This would reduce the impact of PLAIN-only authentication a bit.

Possible approach that I took in my toy server:

cert, err := tls.LoadX509KeyPair("/tmp/goimapd.crt", "/tmp/goimapd.key")
if err != nil {
  fmt.Printf("loadkeys: %s\n", err)
  textconn.PrintfLine("%s BAD Sorry, server-side problem loading certs.", tag, cmd)
  return
}
tlsconfig := &tls.Config{
  Certificates: []tls.Certificate{cert},
}

textconn.PrintfLine("%s OK STARTTLS commencing.", tag)
conn = tls.Server(conn, tlsconfig)
textconn = textproto.NewConn(conn)

It looks like a similar approach could be implemented in imap-server, too: the STARTTLS command could replace c.Rwc with an instance of tls.Server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant