Changeset 2871

Show
Ignore:
Timestamp:
19/02/09 19:36:27 (1 year ago)
Author:
aperez
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/trunk/ChangeLog

    r2870 r2871  
     12009-02-19  Antonio Perez  <aperez@skarcha.com> 
     2 
     3        * cherokee/virtual_server.c, cherokee/virtual_server.h, 
     4        cherokee/cryptor_libssl.c, admin/PageVServer.py: SSL Certificate 
     5        and chained SSL Certificate entries are merged. 
     6 
    172009-02-19  Alvaro Lopez Ortega  <alvaro@octality.com> 
    28 
  • cherokee/trunk/admin/PageVServer.py

    r2869 r2871  
    1313    ("vserver!.*?!document_root",             (validations.is_dev_null_or_local_dir_exists, 'cfg')), 
    1414    ("vserver!.*?!ssl_certificate_file",      (validations.is_local_file_exists, 'cfg', 'nochroot')), 
    15     ("vserver!.*?!ssl_certificate_chain_file",(validations.is_local_file_exists, 'cfg', 'nochroot')), 
    1615    ("vserver!.*?!ssl_certificate_key_file",  (validations.is_local_file_exists, 'cfg', 'nochroot')), 
    1716    ("vserver!.*?!ssl_ca_list_file",          (validations.is_local_file_exists, 'cfg', 'nochroot')), 
     
    2726NOTE_NICKNAME        = 'Nickname for the virtual server.' 
    2827NOTE_CERT            = 'This directive points to the PEM-encoded Certificate file for the server (Full path to the file)' 
    29 NOTE_CERT_CHAIN      = 'Optional: PEM-encoded Certificate Chain file for the server (Full path to the file)' 
    3028NOTE_CERT_KEY        = 'PEM-encoded Private Key file for the server (Full path to the file)' 
    3129NOTE_CA_LIST         = 'Optional: File containing the trusted CA certificates, utilized for checking the client certificates (Full path to the file)' 
     
    238236        table = TableProps() 
    239237        self.AddPropEntry (table, 'Certificate',      '%s!ssl_certificate_file' % (pre),       NOTE_CERT) 
    240         self.AddPropEntry (table, 'Certificate Chain','%s!ssl_certificate_chain_file' % (pre), NOTE_CERT_CHAIN) 
    241238        self.AddPropEntry (table, 'Certificate key',  '%s!ssl_certificate_key_file' % (pre),   NOTE_CERT_KEY) 
    242239        txt += self.Indent(table) 
  • cherokee/trunk/cherokee/cryptor_libssl.c

    r2866 r2871  
    193193        /* Certificate 
    194194         */ 
    195         if (! cherokee_buffer_is_empty (&vsrv->server_cert_chain)) { 
    196  
    197195#if (OPENSSL_VERSION_NUMBER < 0x0090808fL) 
    198                /* OpenSSL < 0.9.8h 
    199                 */ 
    200                ERR_clear_error(); 
     196        /* OpenSSL < 0.9.8h 
     197        */ 
     198        ERR_clear_error(); 
    201199#endif 
    202                 rc = SSL_CTX_use_certificate_chain_file (n->context, vsrv->server_cert_chain.buf); 
    203                 if (rc != 1) { 
    204                         OPENSSL_LAST_ERROR(error); 
    205                         PRINT_ERROR("ERROR: OpenSSL: Can not use certificate chain file '%s':  %s\n",  
    206                                     vsrv->server_cert_chain.buf, error); 
    207                         return ret_error; 
    208                 } 
    209         } else { 
    210                 rc = SSL_CTX_use_certificate_file (n->context, vsrv->server_cert.buf, SSL_FILETYPE_PEM); 
    211                 if (rc != 1) { 
    212                         OPENSSL_LAST_ERROR(error); 
    213                         PRINT_ERROR("ERROR: OpenSSL: Can not use certificate file '%s':  %s\n",  
    214                                     vsrv->server_cert.buf, error); 
    215                         return ret_error; 
    216                 } 
     200        rc = SSL_CTX_use_certificate_chain_file (n->context, vsrv->server_cert.buf); 
     201        if (rc != 1) { 
     202                OPENSSL_LAST_ERROR(error); 
     203                PRINT_ERROR("ERROR: OpenSSL: Can not use certificate file '%s':  %s\n",  
     204                            vsrv->server_cert.buf, error); 
     205                return ret_error; 
    217206        } 
    218207 
  • cherokee/trunk/cherokee/virtual_server.c

    r2862 r2871  
    7878        n->verify_depth    = 1; 
    7979        cherokee_buffer_init (&n->server_cert); 
    80         cherokee_buffer_init (&n->server_cert_chain); 
    8180        cherokee_buffer_init (&n->server_key); 
    8281        cherokee_buffer_init (&n->certs_ca); 
     
    108107{ 
    109108        cherokee_buffer_mrproper (&vserver->server_cert); 
    110         cherokee_buffer_mrproper (&vserver->server_cert_chain); 
    111109        cherokee_buffer_mrproper (&vserver->server_key); 
    112110        cherokee_buffer_mrproper (&vserver->certs_ca); 
     
    163161        if (! cherokee_buffer_is_empty (&vserver->server_cert)) 
    164162                return ret_ok; 
    165         if (! cherokee_buffer_is_empty (&vserver->server_cert_chain)) 
    166                 return ret_ok; 
    167163        if (! cherokee_buffer_is_empty (&vserver->server_key)) 
    168164                return ret_ok; 
     
    181177         */ 
    182178        if (cherokee_buffer_is_empty (&vsrv->server_cert) && 
    183             cherokee_buffer_is_empty (&vsrv->server_cert_chain) && 
    184179            cherokee_buffer_is_empty (&vsrv->server_key)) 
    185180                return ret_not_found; 
     
    187182        /* Check if key or certificate are empty 
    188183         */ 
    189         if (cherokee_buffer_is_empty (&vsrv->server_key) || 
    190             (cherokee_buffer_is_empty (&vsrv->server_cert) && 
    191              cherokee_buffer_is_empty (&vsrv->server_cert_chain))) 
     184        if (cherokee_buffer_is_empty (&vsrv->server_cert) || 
     185            cherokee_buffer_is_empty (&vsrv->server_key)) 
    192186                return ret_error; 
    193187         
     
    710704                cherokee_buffer_add_buffer (&vserver->server_cert, &conf->val); 
    711705 
    712         } else if (equal_buf_str (&conf->key, "ssl_certificate_chain_file")) { 
    713                 cherokee_buffer_init (&vserver->server_cert_chain); 
    714                 cherokee_buffer_add_buffer (&vserver->server_cert_chain, &conf->val); 
    715  
    716706        } else if (equal_buf_str (&conf->key, "ssl_certificate_key_file")) { 
    717707                cherokee_buffer_init (&vserver->server_key); 
  • cherokee/trunk/cherokee/virtual_server.h

    r2862 r2871  
    7070        cuint_t                      verify_depth; 
    7171        cherokee_buffer_t            server_cert; 
    72         cherokee_buffer_t            server_cert_chain; 
    7372        cherokee_buffer_t            server_key; 
    7473        cherokee_buffer_t            certs_ca;