cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Can't use curl with TLSv1.2 (OpenSSL)

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Wed, 16 Oct 2013 23:51:04 +0100

On Wed, 16 Oct 2013, Steve Holme wrote:

> I will look into the POP3 / IMAP issues.

I have been debugging this since my commit and discovered that these
commands in my opinion shouldn't even be sent if the SSL code fails, as we
are instigating a SSL connection so the protocol layer isn't active yet. If
the connection is a TLS upgrade on the other hand then QUIT / LOGOUT should
be sent to the server as the protocol layer is active.

The reason SMTPS is working for me is that I seem to be getting the server
greeting even though the SSL connection has failed :( but in POP3S and IMAPS
I don't even though the protocol connect functions take the same code path
and both return the same error result!

Even with the oddity on SMTPS I think we need to check for
xxxx->conn->bits.protoconnstart before calling the quit / logout functions.
My only query here, is do other protocols such as FTPS need to do this as
well?

For example:

In imap_disconnect() :

  if(!dead_connection && imapc->pp.conn &&
imapc->pp.conn->bits.protoconnstart)
    if(!imap_perform_logout(conn))
      (void)imap_block_statemach(conn); /* ignore errors on LOGOUT */

Possibly in ftp_disconnect() :

  if(dead_connection && imapc->pp.conn->bits.protoconnstart)
    ftpc->ctl_valid = FALSE;

  /* The FTP session may or may not have been allocated/setup at this point!
*/
  (void)ftp_quit(conn); /* ignore errors on the QUIT */

Kind Regards

Steve
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-10-17