cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Different treatment of "no SSL support on server side" in FTP and SMTP

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Tue, 3 Jan 2012 22:51:14 +0000

Hi Gokhan,

> It looks from the code that when SMTP server does not support
> SSL/TLS and sends a 5xx reply, libcurl responds its caller with
> CURLE_LOGIN_DENIED. When it comes to FTP server case,
> getting a negative response to AUTH command, libcurl is
> giving the error CURLE_USE_SSL_FAILED.

I've checked the code and it does indeed return CURLE_LOGIN_DENIED. I am assuming that you set your SSL options to something other than CURLUSESSL_TRY as it will continue to authenticate if you specify this option when SSL is not available on the server.

> I think CURLE_USE_SSL_FAILED expresses the situation better,
> because it has almost nothing to do with the login
> (authentication) except maybe implicit SSL case because if
> server would support SSL then login could succeed.

I've got a tendency to agree with you but I don't know the historical reasons for it being CURLE_LOGIN_DENIED. Perhaps Daniel / Dan / Yang can help me out here - however, in the meantime I can write up a patch.

> My suggestion would be to use FTP's treatment for SMTP
> (the one I am interested) and maybe for other modules
> (IMAP and POP3) to be truly consistent.

I've looked at the POP3 and IMAP code as well and they return the same error code as SMTP. However, neither of these two check the state of the SSL option which would allow the connection to continue. I wonder whether these two should also do the same as SMTP here??

Kind Regards

Steve

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-01-03