Changeset 640

Show
Ignore:
Timestamp:
28/07/08 10:59: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

    r564 r640  
    739739        return 1; 
    740740 
    741     /* !!! output openssl error messages to the debug log */ 
    742  
    743741    /* create the context */ 
    744742    ctx = SSL_CTX_new(SSLv23_method()); 
     
    752750        ret = SSL_CTX_load_verify_locations (ctx, cachain, NULL); 
    753751        if(ret != 1) { 
    754             _sx_debug(ZONE, "WARNING: couldn't load CA chain: %s", cachain); 
     752            _sx_debug(ZONE, "WARNING: couldn't load CA chain: %s; %s", cachain, ERR_error_string(ret, NULL)); 
    755753        } 
    756754    } 
     
    759757    ret = SSL_CTX_use_certificate_chain_file(ctx, pemfile); 
    760758    if(ret != 1) { 
    761         _sx_debug(ZONE, "couldn't load certificate from %s", pemfile); 
     759        _sx_debug(ZONE, "couldn't load certificate from %s; %s", pemfile, ERR_error_string(ret, NULL)); 
    762760        SSL_CTX_free(ctx); 
    763761        return 1; 
     
    767765    ret = SSL_CTX_use_PrivateKey_file(ctx, pemfile, SSL_FILETYPE_PEM); 
    768766    if(ret != 1) { 
    769         _sx_debug(ZONE, "couldn't load private key from %s", pemfile); 
     767        _sx_debug(ZONE, "couldn't load private key from %s; %s", pemfile, ERR_error_string(ret, NULL)); 
    770768        SSL_CTX_free(ctx); 
    771769        return 1; 
     
    775773    ret = SSL_CTX_check_private_key(ctx); 
    776774    if(ret != 1) { 
    777         _sx_debug(ZONE, "private key does not match certificate public key"); 
     775        _sx_debug(ZONE, "private key does not match certificate public key; %s", ERR_error_string(ret, NULL)); 
    778776        SSL_CTX_free(ctx); 
    779777        return 1;