-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Problem with SMTP + STARTTLS sending using libcurl 8.8.0 that did not exist in 8.7.1 #14166
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
Comments
The garbage in your trace output look suspicious. Can you add the following to your client after
Thanks. |
Thanks for helping.... New output after global trace all has been added to sample (below find also output when using 8.7.1 which runs ok)....
Output when succesfully using libcurl 8.7.1:
|
Thanks, that helps. @bagder: I can reproduce when I mess with
Question: what makes |
@icing thanks for investigating. I did a little debugging and step by step and this is what I found. Don't know if it helps but digging a little deeper call stack (line numbers might be off because of me adding some debugging lines): Hope it helps somehow, let me know if I can do anything else. |
- make sure the TLS handshake after a successful STARTTLS command is fully done before further sending/receiving on the connection. - refs curl#14166
I propose #14190 to fix this. |
@icing thanks for the PR, I've taken the code from your branch, compiled and used it against my sample and it works OK now. When will the new curl release with this fix be officially released? |
Thanks for confirming! I think we'll merge this into the 8.9 release on July 24th. |
8.9 release by the end of the month works fine for me :), thank you very much for fixing this. |
- make sure the TLS handshake after a successful STARTTLS command is fully done before further sending/receiving on the connection. Reported-by: tomy2105 on github Fixes curl#14166 Closes curl#14190
I did this
I have a small sample based on "official" TLS sample (code below) which send email using smtp + StartTLS.
Compiled on Windows, with libcurl 8.7.1 and OpenSSL 3.0.13 the sample worked OK.
However compiled on Windows, with libcurl 8.8.0 and same OpenSSL 3.0.13 the sample fails (see output below).
I've also examined Wireshark logs for both runs and it seems that libcurl 8.8.0 errors out in the place where 8.7.1 sends "Content Type: Change Cipher Spec (20)".
What causes it to fail on 8.8.0?
Can I somehow fix it with different options or....?
Another observation, if I enable smtps (different port) and use encryption from the beginning and not StartTLS, then both libcurl 8.7.1 and 8.8.0 work correctly.
Thank you in advance for help.
Wireshark screenshot for 8.7.1:


Wireshark screenshot for 8.8.0:
Complete Wireshark trace for 8.7.1: curl_8.7.1_mailjet.pcapng.gz
Complete Wireshark trace for 8.8.0: curl_8.8.0_mailjet.pcapng.gz
Output of failed run with 8.8.0:
Source code of sample:
I expected the following
Sample work both with libcurl 8.7.1 and libcurl 8.8.0.
curl/libcurl version
curl 8.8.0
operating system
Windows Server 2022 or Windows 10
The text was updated successfully, but these errors were encountered: