cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: SMTP SSL does not start, no authentication (was empty subject)

From: Patrick MONNERAT <patrick.monnerat_at_datasphere.ch>
Date: Tue, 19 Oct 2010 18:23:12 +0200

On Tue, 2010-10-19 at 17:48 +0200, Daniel Stenberg wrote:
> On Tue, 19 Oct 2010, Alona Rossen wrote:
>
> > Adding curl_easy_setopt(curl,CURLOPT_USE_SSL, CURLUSESSL_ALL) did not
> > fix the problem
>
> Is your libcurl built with SSL enabled?
>

You could also check the version of libcurl you use.

I just tried your program against the git version of libcurl:

* About to connect() to smtp.gmail.com port 587 (#0)
* Trying 74.125.43.109... * connected
* Connected to smtp.gmail.com (74.125.43.109) port 587 (#0)
< 220 mx.google.com ESMTP u4sm15536705bkz.5
> EHLO linuxdev.datasphere.ch
< 250-mx.google.com at your service, [195.70.0.136]
< 250-SIZE 35651584
< 250-8BITMIME
< 250-STARTTLS
< 250 ENHANCEDSTATUSCODES
* No known auth mechanisms supported!
> QUIT
< 221 2.0.0 closing connection u4sm15536705bkz.5
* Closing connection #0
* Login denied

Now with curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL) added:
* About to connect() to smtp.gmail.com port 587 (#0)
* Trying 74.125.43.109... * connected
* Connected to smtp.gmail.com (74.125.43.109) port 587 (#0)
< 220 mx.google.com ESMTP t10sm12364723bkj.4
> EHLO linuxdev.datasphere.ch
< 250-mx.google.com at your service, [195.70.0.136]
< 250-SIZE 35651584
< 250-8BITMIME
< 250-STARTTLS
< 250 ENHANCEDSTATUSCODES
> STARTTLS
< 220 2.0.0 Ready to start TLS
* successfully set certificate verify locations:
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using RC4-MD5
* Server certificate:
* subject: C=US; ST=California; L=Mountain View; O=Google Inc;
CN=smtp.gmail.com
* start date: 2010-04-22 20:02:45 GMT
* expire date: 2011-04-22 20:12:45 GMT
* issuer: C=US; O=Google Inc; CN=Google Internet Authority
* SSL certificate verify ok.
> EHLO linuxdev.datasphere.ch
< 250-mx.google.com at your service, [195.70.0.136]
< 250-SIZE 35651584
< 250-8BITMIME
< 250-AUTH LOGIN PLAIN XOAUTH
< 250 ENHANCEDSTATUSCODES
> AUTH PLAIN
WFhYWFhYWFhAZ21haWwuY29tAFhYWFhYWFhYQGdtYWlsLmNvbQBYWFhYWFhYWFg=
< 535-5.7.1 Username and Password not accepted. Learn more
at
< 535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257
t10sm12364723bkj.4
* Authentication failed: 535
> QUIT
< 221 2.0.0 closing connection t10sm12364723bkj.4
* Closing connection #0
* Login denied

which is quite better: the authentication error is normal because I kept
your obfuscated access codes. However we can see that SSL handshake is
performed successfully, that the server supports authentication in SSL
mode, and that libcurl does attempt authentication in this case !
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-10-19