-
-
Notifications
You must be signed in to change notification settings - Fork 67
fix: add TLS session resumption #1304
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
base: master
Are you sure you want to change the base?
Changes from all commits
aa697a0
74b3563
2fddfbd
df5a3aa
b9f874c
477fc28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -376,6 +376,11 @@ func connectWithOptions(account *config.Account, extraOpts *imapclient.Options) | |
| ServerName: imapServer, | ||
| InsecureSkipVerify: account.Insecure, | ||
| MinVersion: tls.VersionTLS12, | ||
| ClientSessionCache: account.GetClientSessionCache(), | ||
| VerifyConnection: func(cs tls.ConnectionState) error { | ||
| log.Printf("IMAP TLS connection resumed: %t", cs.DidResume) | ||
| return nil | ||
| }, | ||
|
Comment on lines
+379
to
+383
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will fire on every connection |
||
| }, | ||
| } | ||
| if extraOpts != nil { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ import ( | |
| "errors" | ||
| "fmt" | ||
| "io" | ||
| "log" | ||
| "mime" | ||
| "mime/multipart" | ||
| "mime/quotedprintable" | ||
|
|
@@ -660,6 +661,11 @@ func SendEmail(account *config.Account, to, cc, bcc []string, subject, plainBody | |
| ServerName: smtpServer, | ||
| InsecureSkipVerify: account.Insecure, | ||
| MinVersion: tls.VersionTLS12, | ||
| ClientSessionCache: account.GetClientSessionCache(), | ||
| VerifyConnection: func(cs tls.ConnectionState) error { | ||
| log.Printf("SMTP TLS connection resumed: %t", cs.DidResume) | ||
| return nil | ||
| }, | ||
|
Comment on lines
+664
to
+668
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will too |
||
| } | ||
|
|
||
| var c *smtp.Client | ||
|
|
@@ -870,10 +876,16 @@ func SendCalendarReply(account *config.Account, to []string, subject, plainBody | |
|
|
||
| // Send via SMTP | ||
| addr := fmt.Sprintf("%s:%d", smtpServer, smtpPort) | ||
|
|
||
| tlsConfig := &tls.Config{ | ||
| ServerName: smtpServer, | ||
| InsecureSkipVerify: account.Insecure, | ||
| MinVersion: tls.VersionTLS12, | ||
| ClientSessionCache: account.GetClientSessionCache(), | ||
| VerifyConnection: func(cs tls.ConnectionState) error { | ||
| log.Printf("SMTP TLS connection resumed: %t", cs.DidResume) | ||
| return nil | ||
| }, | ||
|
Comment on lines
+885
to
+888
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and here |
||
| } | ||
|
|
||
| var c *smtp.Client | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.