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

TLS handshake failure when used with go 1.22.0 #100

Closed
fosmjo opened this issue Feb 28, 2024 · 3 comments
Closed

TLS handshake failure when used with go 1.22.0 #100

fosmjo opened this issue Feb 28, 2024 · 3 comments
Assignees

Comments

@fosmjo
Copy link

fosmjo commented Feb 28, 2024

I'm using v2.16.0 with go 1.22.0. An error occurred when I call SMTPServer.Connect(), here is the error message:

connect to smtp server: Mail Error on dialing with encryption type SSL/TLS: remote error: tls: handshake failure

It works with go 1.21.6.

@xhit
Copy link
Owner

xhit commented Feb 28, 2024

Thanks for the report, I will investigate this.

@xhit xhit self-assigned this Feb 28, 2024
@fosmjo
Copy link
Author

fosmjo commented Feb 29, 2024

I've solved the problem. According to go1.22 release notes, crypto/tls no longer offers cipher suites that don't support ECDHE, and our mail server only supports cipher suites that support RSA, the TLS handshake failed. One of the solutions is to add support for RSA cipher suites with the tlsrsakex=1 GODEBUG setting, another one is to add cipher suites that support RSA manually by using tls.Config.

@xhit
Copy link
Owner

xhit commented Feb 29, 2024

Perfect @fosmjo! I will pin this issue to inform other devs. Thanks for the research!

@xhit xhit closed this as completed Feb 29, 2024
@xhit xhit pinned this issue Feb 29, 2024
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

2 participants