Changeset 2082

Show
Ignore:
Timestamp:
06/06/07 13:54:07
Author:
pvanhoof
Message:

Various SSL fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libtinymail-camel/camel-lite/camel/camel-tcp-stream-openssl.c

    r2077 r2082  
    5454#include "camel-tcp-stream-ssl.h" 
    5555 
    56 #define d(x) g_print (x) 
     56#define d(x) 
    5757 
    5858static CamelTcpStreamClass *parent_class = NULL; 
  • trunk/libtinymail-camel/camel-lite/camel/camel-tcp-stream-ssl.c

    r2063 r2082  
    317317        g_return_val_if_fail (CAMEL_IS_TCP_STREAM_SSL (ssl), -1); 
    318318         
    319         if (ssl->priv->sockfd && !ssl->priv->ssl_mode) { 
    320                 if (!(fd = enable_ssl (ssl, NULL))) { 
     319        if (ssl->priv->sockfd && !ssl->priv->ssl_mode)  
     320        { 
     321 
     322                if (!(fd = enable_ssl (ssl, NULL)))  
     323                { 
    321324                        set_errno (PR_GetError ()); 
    322325                        return -1; 
    323326                } 
    324                  
     327 
    325328                ssl->priv->sockfd = fd; 
    326                  
    327                 if (SSL_ResetHandshake (fd, FALSE) == SECFailure) { 
     329 
     330                if (SSL_ResetHandshake (fd, FALSE) == SECFailure)  
     331                { 
    328332                        set_errno (PR_GetError ()); 
    329333                        return -1; 
    330334                } 
    331                  
    332                 if (SSL_ForceHandshake (fd) == -1) { 
     335 
     336                if (SSL_ForceHandshake (fd) == SECFailure)  
     337                { 
    333338                        set_errno (PR_GetError ()); 
    334339                        return -1; 
    335340                } 
    336341        } 
    337          
     342 
    338343        ssl->priv->ssl_mode = TRUE; 
    339          
     344 
    340345        return 0; 
    341346} 
     
    528533                        nread = -1; 
    529534 
    530                         res = PR_Poll(pollfds, 2, 5); 
     535                        res = PR_Poll(pollfds, 2, PR_TicksPerSecond () * 5); 
    531536 
    532537                        if (res == -1) 
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c

    r2081 r2082  
    639639#ifdef HAVE_SSL 
    640640#define SSL_PORT_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3) 
    641 #define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3) 
     641#define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS) /* | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)*/ 
    642642#endif 
    643643 
     
    850850        { 
    851851                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, 
    852                                 _("Failed to connect to IMAP server %s in secure mode: %s"), 
    853                                 service->url->host, _("SSL negotiations failed")); 
     852                                _("Failed to connect to IMAP server %s in secure mode: %s (%s)"), 
     853                                service->url->host, _("SSL negotiations failed"), strerror (errno)); 
    854854                goto exception; 
    855855        } 
     
    869869        { 
    870870                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, 
    871                         _("Failed to connect to IMAP server %s"), 
     871                        _("Failed to connect to IMAP server %s (%s)"), 
    872872                        service->url->host, _("Reading second CAPABILITY failed")); 
    873873                goto exception;