Changeset 641

Show
Ignore:
Timestamp:
28/07/08 11:02:58 (4 months ago)
Author:
smoku
Message:

Added SSL error messages to debug output

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/sx/ssl.c

    r640 r641  
    742742    ctx = SSL_CTX_new(SSLv23_method()); 
    743743    if(ctx == NULL) { 
    744         _sx_debug(ZONE, "ssl context creation failed"); 
     744        _sx_debug(ZONE, "ssl context creation failed; %s", ERR_error_string(ERR_get_error(), NULL)); 
    745745        return 1; 
    746746    } 
     
    750750        ret = SSL_CTX_load_verify_locations (ctx, cachain, NULL); 
    751751        if(ret != 1) { 
    752             _sx_debug(ZONE, "WARNING: couldn't load CA chain: %s; %s", cachain, ERR_error_string(ret, NULL)); 
     752            _sx_debug(ZONE, "WARNING: couldn't load CA chain: %s; %s", cachain, ERR_error_string(ERR_get_error(), NULL)); 
    753753        } 
    754754    } 
     
    757757    ret = SSL_CTX_use_certificate_chain_file(ctx, pemfile); 
    758758    if(ret != 1) { 
    759         _sx_debug(ZONE, "couldn't load certificate from %s; %s", pemfile, ERR_error_string(ret, NULL)); 
     759        _sx_debug(ZONE, "couldn't load certificate from %s; %s", pemfile, ERR_error_string(ERR_get_error(), NULL)); 
    760760        SSL_CTX_free(ctx); 
    761761        return 1; 
     
    765765    ret = SSL_CTX_use_PrivateKey_file(ctx, pemfile, SSL_FILETYPE_PEM); 
    766766    if(ret != 1) { 
    767         _sx_debug(ZONE, "couldn't load private key from %s; %s", pemfile, ERR_error_string(ret, NULL)); 
     767        _sx_debug(ZONE, "couldn't load private key from %s; %s", pemfile, ERR_error_string(ERR_get_error(), NULL)); 
    768768        SSL_CTX_free(ctx); 
    769769        return 1; 
     
    773773    ret = SSL_CTX_check_private_key(ctx); 
    774774    if(ret != 1) { 
    775         _sx_debug(ZONE, "private key does not match certificate public key; %s", ERR_error_string(ret, NULL)); 
     775        _sx_debug(ZONE, "private key does not match certificate public key; %s", ERR_error_string(ERR_get_error(), NULL)); 
    776776        SSL_CTX_free(ctx); 
    777777        return 1;