Changeset 1353

Show
Ignore:
Timestamp:
05/28/04 11:51:30 (5 years ago)
Author:
morris
Message:

add SSL_connect failed error message

add logging for SSL_read/write return codes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/WCSecureSocket.m

    r1337 r1353  
    1 /* $Id: WCSecureSocket.m,v 1.10 2004/05/24 14:11:17 morris Exp $ */ 
     1/* $Id: WCSecureSocket.m,v 1.11 2004/05/28 09:51:30 morris Exp $ */ 
    22 
    33/* 
     
    105105         
    106106        if(!_ssl) { 
    107                 [[_connection error] setError:WCConnectionErrorSSLFailed]; 
     107                [[_connection error] setError:WCConnectionErrorSSLConnectFailed]; 
    108108                 
    109109                return -1; 
     
    111111         
    112112        if(SSL_set_fd(_ssl, _sd) != 1) { 
    113                 [[_connection error] setError:WCConnectionErrorSSLFailed]; 
     113                [[_connection error] setError:WCConnectionErrorSSLConnectFailed]; 
    114114                 
    115115                return -1; 
     
    117117         
    118118        if(SSL_connect(_ssl) != 1) { 
    119                 [[_connection error] setError:WCConnectionErrorSSLFailed]; 
     119                [[_connection error] setError:WCConnectionErrorSSLConnectFailed]; 
    120120                 
    121121                return -1; 
     
    157157                 
    158158                if(state < 0) { 
     159                        NSLog(@"select: %s", strerror(errno)); 
    159160                        [[_connection error] setError:WCConnectionErrorReadFailed]; 
    160161                         
     
    170171                } 
    171172                else if(bytes < 0) { 
     173                        NSLog(@"SSL_read: %s, %s", ERR_reason_error_string(ERR_get_error()), strerror(errno)); 
    172174                        [[_connection error] setError:WCConnectionErrorSSLFailed]; 
    173175                         
     
    228230    else if(bytes == -1) { 
    229231        // --- error 
     232                NSLog(@"SSL_read: %s, %s", ERR_reason_error_string(ERR_get_error()), strerror(errno)); 
    230233        [[_connection error] setError:WCConnectionErrorSSLFailed]; 
    231234                 
     
    249252         
    250253        if(bytes < 0) { 
     254                NSLog(@"SSL_read: %s, %s", ERR_reason_error_string(ERR_get_error()), strerror(errno)); 
    251255                [[_connection error] setError:WCConnectionErrorSSLFailed]; 
    252256