mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-08 01:33:43 +08:00
fix: Remove InsecureSkipVerify option in TLS config for
email sending.
This commit is contained in:
@@ -24,8 +24,8 @@ func SendEmail(subject string, receiver string, content string) error {
|
|||||||
var err error
|
var err error
|
||||||
if SMTPPort == 465 {
|
if SMTPPort == 465 {
|
||||||
tlsConfig := &tls.Config{
|
tlsConfig := &tls.Config{
|
||||||
InsecureSkipVerify: true,
|
// InsecureSkipVerify: true,
|
||||||
ServerName: SMTPServer,
|
ServerName: SMTPServer,
|
||||||
}
|
}
|
||||||
conn, err := tls.Dial("tcp", fmt.Sprintf("%s:%d", SMTPServer, SMTPPort), tlsConfig)
|
conn, err := tls.Dial("tcp", fmt.Sprintf("%s:%d", SMTPServer, SMTPPort), tlsConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user