-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Possible problem with TLS and SMTP causing timeout in curl 8.12 #16189
Comments
the smtp.c file didn't change, but probably something with connection filters? |
So in smtp_perform_upgrade_tls, the function calls Curl_conn_connect and expects ssldone to be set to true eventually. This doesn't happen with the current version as I see. But in smtp_multi_statemach, I noticed that Curl_conn_connect sets the ssldone variable there. I can add a check there to call smtp_perform_ehlo as a workaround to fix the issue for me.
Then it seems to work here. But I would prefer if the underlaying problem could be fixed. |
@MonkeybreadSoftware I cannot connect to the url you posted. When I use my own mail server, everything works fine. Can you produce a log with |
it's sslout.df.eu but I thought I should xxx that out. I build it again without my patch:
So I run it:
|
Thanks, reproducing here locally. Analysing... |
There were two places in the code that tried to connect the SSL filter, e.g. do the TLS handshake, but only one changed stmp state to EHLO afterwards. Depending on timing, the wrong path was taken and the connection was hanging, waiting for a server reply to a command not sent. Do the upgrade to tls in one place and update connection filter and smtps protocol handler at the same time. Always transition to EHLO on success. refs curl#16189
Ok, found it. Proposing #16206 as fix. Could you verify? Thanks. |
Would it be useful to make a few tests, which try to connect to a few smtp servers in different combinations and try to see if we come to the authentication part? |
Adding tests for this would be awesome of course. However, I don't think our test suite should use any remotely accessed servers, only things we run locally. Because that's how our test suite runs (and a enough number of users run the test suite without access to the internet), because we don't run those other servers and don't want our test suite to become a DDOS attack on them and because using "random" remote servers tend to be fragile and flaky. |
I did this
So I connect with CURL 8.12 and I see this output:
curl -k --ssl -v "smtp://sslout.xxx.eu:25"
...
curl: (28) server response timeout
So we get a timeout as EHLO is not sent.
Doing the same with
curl -k -v "smtps://sslout.df.eu:465"
Shows this:
...
< 220 smtprelay06.xxx.xx ESMTP dfex
EHLO MyMac
< 250-smtprelay06.xxx.xx Hello MyMacM3 [xxx]
And using the first variant with command line tool using older curl version, I see
EHLO MyMac
< 250-smtprelay08.xxx.xx Hello MyMacM3 [xxx]
So for some reason I don't see yet, we don't get to the state when to send EHLO.
Has anyone seen this?
I expected the following
SMTP with STARTTLS should work.
curl/libcurl version
curl 8.12.0
operating system
macOS. Also on happens on Windows.
The text was updated successfully, but these errors were encountered: