cURL

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1372 [libcurl-Mac]SMTP cannot select AUTH option and auth with DIGEST-MD5 failed

From: Steve Holme <captain-caveman_at_users.sf.net>
Date: Fri, 16 May 2014 10:22:33 +0000

Hi,

Thank you for your report.

1) The options parameter in CURLOPT_USERPWD was only supported in libcurl >= 7.31 && < 7.34.0. In newer versions it is implemented in CURLOPT_LOGIN_OPTIONS.

2) DIGEST-MD5 for SMTP was added in v7.26.0 and does work. However, some servers are giving us a little bit of grief. Unfortuantely, ww haven't got to the bottom of this yet but one theory is that it could be because these servers are expecting certain "optional" values in the response which we are not supplying. I have taken a look at what the server sent you (by base64 decoding the string) and I can see that it is supports UTF-8 encoding as specified in the charset directive. We aren't supplying that back in our response, and as such the server should assume ISO 8859-1 encoding - however, it could be that the server is expecting that value to be there and failing because it isn't.

Do you know if there is any documentation for the DIGEST-MD5 implementation for that server?

It not are you able to assist with testing the latest libcurl code and diagnosing what the problem is?

I added one of the optional fields "qop" in our responses for the upcoming 7.37.0 release and can come up with a patch for charset if you are able to assist.

Kind Regards

Steve

---
** [bugs:#1372] [libcurl-Mac]SMTP cannot select AUTH option and auth with DIGEST-MD5 failed**
**Status:** open
**Created:** Fri May 16, 2014 06:49 AM UTC by Loik
**Last Updated:** Fri May 16, 2014 06:54 AM UTC
**Owner:** Steve Holme
Hi All,
I'm using libcurl with Mac OSX and load the dynamic library from xcode SDK.
We set a Mac OSX server and it support LOGIN, PLAIN, CRAM-MD5 and DIGEST-MD5, when we execute the libcurl with smtp code under 10.7 /10.8, libcurl use CRAM-MD5 to do auth but use DIGEST-MD5 under osx 10.9.
In 10.7/10.8 the CRAM-MD5 always return 
> AUTH CRAM-MD5
< 334 PDQ2Mzg0Li1kOUF3R09CSXVRbjdlNjhiLi0xNDAwMjIyMTkzLUAtQnJ1Y2VzLU1hY0Jvb2stUHJvLmxvY2FsPg==
> QnJ1Y2UgNTgwNDVkODBiM2UzOWEzMDRiYTBjM2VjNzcwNmU5MDY=
< 235 Authentication successful
But under 10.9 libcurl use DIGEST-MD5 and always failed.
I found the flag curl_easy_setopt(curl, CURLOPT_USERPWD, "username:password;option");
it can select the AUTH mode, but it not working by my environment, I already  set AUTH=PLAIN or AUTH=CRAM-MD5 but libcurl still auth with DIGEST-MD5.
My question is 
1. Why curl_easy_setopt(curl, CURLOPT_USERPWD, "username:password;option"); cannot select AUTH mode.
2. Why libcurl 7.30.0 cannot support DIGEST-MD5
The DIGEST-MD5 failed message as below
My test platform
OSX 10.7 
xcode 4.1 with libcurl 7.21.4
OSX 10.8
xcode 4.6 with libcurl 7.26.0
OSX 10.9
xcode 5.0 with libcurl 7.30.0
Server is  OSX Server 3.0.1
* About to connect() to 192.168.208.214 port 25 (#0)
*   Trying 192.168.208.214...
* Adding handle: conn: 0x101016000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x101016000) send_pipe: 1, recv_pipe: 0
* Connected to 192.168.208.214 (192.168.208.214) port 25 (#0)
< 220 Bruces-MacBook-Pro.local ESMTP Postfix
> EHLO afp19216820489
< 250-Bruces-MacBook-Pro.local
< 250-PIPELINING
< 250-SIZE 10485760
< 250-VRFY
< 250-ETRN
< 250-STARTTLS
< 250-AUTH LOGIN PLAIN CRAM-MD5 DIGEST-MD5
< 250-ENHANCEDSTATUSCODES
< 250-8BITMIME
< 250-DSN
< 250-BINARYMIME
< 250 CHUNKING
> AUTH DIGEST-MD5
< 334 cmVhbG09IkJydWNlcy1NYWNCb29rLVByby5sb2NhbCIsbm9uY2U9ImQ4alZjYlE1TVNGbUxuUUFYY1pyM2NrNXk4VDYzSXUiLHFvcD0iYXV0aCIsYWxnb3JpdGhtPW1kNS1zZXNzLGNoYXJzZXQ9dXRmLTg=
> dXNlcm5hbWU9IkJydWNlIixyZWFsbT0iQnJ1Y2VzLU1hY0Jvb2stUHJvLmxvY2FsIixub25jZT0iZDhqVmNiUTVNU0ZtTG5RQVhjWnIzY2s1eThUNjNJdSIsY25vbmNlPSJmNjNjNDA5YSIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJzbXRwL0JydWNlcy1NYWNCb29rLVByby5sb2NhbCIscmVzcG9uc2U9NTQzYTkzMjY0NWY5OThmYTdjYTk4NmU4ZmY2NTFjMGQ=
< 535 Error: authentication failed
* Authentication failed: 535
* Closing connection 0
curl_easy_perform() failed: Login denied
Program ended with exit code: 67
Thanks a lot.
---
Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2014-05-16

These mail archives are generated by hypermail.

donate! Page updated March 21, 2014.
web site info

File upload with ASP.NET