Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
11b49ff1
Commit
11b49ff1
authored
Dec 14, 2010
by
Anthony Martin
Committed by
Russ Cox
Dec 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smtp: add *tls.Config argument to StartTLS
R=rsc, agl1 CC=golang-dev
https://golang.org/cl/3573044
parent
d110ae8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/pkg/smtp/smtp.go
src/pkg/smtp/smtp.go
+3
-3
No files found.
src/pkg/smtp/smtp.go
View file @
11b49ff1
...
...
@@ -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
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment