cURL / Mailing Lists / curl-library / Single Mail

curl-library

SMTP/STARTTLS with axTLS - hangs around smtp_perform_upgrade_tls()

From: Chris Ghormley <chris_at_set-point.com>
Date: Thu, 18 Jul 2013 18:14:54 -0700

I would like to be able to send email using curl built with axTLS but
without OpenSSL.

I have built curl/libcurl 7.31.0 and the smtp-tls.c example on my Linux
PC with the following shared libraries:

$ ldd smtp-tls-test
    linux-gate.so.1 => (0x0089e000)
    libcurl.so.5 => /usr/local/lib/libcurl.so.5 (0x002aa000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x00922000)
    libaxtls.so.1 => /usr/local/lib/libaxtls.so.1 (0x00acb000)
    libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0x005df000)
    librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0x0068c000)
    /lib/ld-linux.so.2 (0x001f6000)
    libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0x00f15000)

smtp-tls-test.c only differs from smtp-tls.c in email address, server
and certificate path information, to connect to smtp.gmail.com:587.

When I run my smtp-tls-test, it connects to smtp.gmail.com port 587 then
waits...for what?

$ ./smtp-tls-test
* About to connect() to smtp.gmail.com port 587 (#0)
* Trying 74.125.129.108...
* Adding handle: conn: 0x9623518
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x9623518) send_pipe: 1, recv_pipe: 0
* Connected to smtp.gmail.com (74.125.129.108) port 587 (#0)
< 220 mx.google.com ESMTP x8sm15559988pbb.39 - gsmtp
> EHLO testmachine
< 250-mx.google.com at your service, [174.25.54.187]
< 250-SIZE 35882577
< 250-8BITMIME
< 250-STARTTLS
< 250 ENHANCEDSTATUSCODES
> STARTTLS
< 220 2.0.0 Ready to start TLS
* found certificates in /etc/ssl/certs/ca-certificates.crt

Based on tcpdump, I can see that the server provides the certificate
chain, but then I lose the thread.

smtp_statemach_act() gets called about 10 times, then poll() in
Curl_socket_check() starts returning 0 and nothing else seems to happen.

It will sit at this point and time out eventually if I don't kill it.
When I rebuild libcurl with OpenSSL the program works as expected.

I found this related post, but I'm not sure how it helps.

    http://curl.haxx.se/mail/lib-2013-01/0303.html

Any ideas?

-- 
 Chris Ghormley / Set-Point Control
 chris_at_set-point.com
 503-484-5074 mobile
 503-255-2775 office
 503-255-6027 fax
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-07-19