aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Martin <ality@pbrane.org>2010-12-14 12:22:08 -0500
committerRuss Cox <rsc@golang.org>2010-12-14 12:22:08 -0500
commit11b49ff1243749a6684f8e5882a0b42641309f26 (patch)
treeb7de68692b1d238ce565a8f1abd93feaffbce1b6
parentd110ae8dd0e9fbbd1af320d60818b9e650a71e19 (diff)
downloadgo-11b49ff1243749a6684f8e5882a0b42641309f26.tar.gz
go-11b49ff1243749a6684f8e5882a0b42641309f26.zip
smtp: add *tls.Config argument to StartTLS
R=rsc, agl1 CC=golang-dev https://golang.org/cl/3573044
-rw-r--r--src/pkg/smtp/smtp.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/smtp/smtp.go b/src/pkg/smtp/smtp.go
index 3b805166ef..2f6d2f31a7 100644
--- a/src/pkg/smtp/smtp.go
+++ b/src/pkg/smtp/smtp.go
@@ -114,12 +114,12 @@ func (c *Client) ehlo() os.Error {
// StartTLS sends the STARTTLS command and encrypts all further communication.
// Only servers that advertise the STARTTLS extension support this function.
-func (c *Client) StartTLS() os.Error {
+func (c *Client) StartTLS(config *tls.Config) os.Error {
_, _, err := c.cmd(220, "STARTTLS")
if err != nil {
return err
}
- c.conn = tls.Client(c.conn, nil)
+ c.conn = tls.Client(c.conn, config)
c.Text = textproto.NewConn(c.conn)
c.tls = true
return c.ehlo()
@@ -231,7 +231,7 @@ func SendMail(addr string, a Auth, from string, to []string, msg []byte) os.Erro
return err
}
if ok, _ := c.Extension("STARTTLS"); ok {
- if err = c.StartTLS(); err != nil {
+ if err = c.StartTLS(nil); err != nil {
return err
}
}