Changeset 2036

Show
Ignore:
Timestamp:
01/16/2008 12:47:37 AM (6 months ago)
Author:
glen
Message:

- ssl.cipher-list and ssl.use-sslv2 ported from 1.4.x (#1422)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/NEWS

    r2029 r2036  
    1212  * execute fcgi app without /bin/sh if used as argument to spawn-fcgi (#1428) 
    1313  * fix bug that rrdtool reports "0" for incoming data (#1514) 
     14  * ssl.cipher-list and ssl.use-sslv2 ported from 1.4.x (#1422) 
    1415 
    1516- 1.5.0-r19.. - 
  • trunk/src/base.h

    r1885 r2036  
    299299        buffer *ssl_pemfile; 
    300300        buffer *ssl_ca_file; 
     301        buffer *ssl_cipher_list; 
     302        unsigned short ssl_use_sslv2; 
    301303        unsigned short use_ipv6; 
    302304        unsigned short is_ssl; 
     
    306308 
    307309        unsigned short kbytes_per_second; /* connection kb/s limit */ 
    308  
     310         
    309311        /* configside */ 
    310312        unsigned short global_kbytes_per_second; /*  */ 
     
    570572        buffer *ssl_pemfile; 
    571573        buffer *ssl_ca_file; 
     574        buffer *ssl_cipher_list; 
     575        unsigned short ssl_use_sslv2; 
    572576        unsigned short use_ipv6; 
    573577        unsigned short is_ssl; 
  • trunk/src/configfile.c

    r1867 r2036  
    9898                { "server.max-connection-idle",  NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },   /* 50 */ 
    9999                { "debug.log-timing",            NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER },     /* 51 */ 
     100                { "ssl.cipher-list",             NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER },      /* 52 */ 
     101                { "ssl.use-sslv2",               NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 53 */ 
    100102 
    101103                { "server.host",                 "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET }, 
     
    163165                s->server_tag    = buffer_init(); 
    164166                s->errorfile_prefix = buffer_init(); 
     167                s->ssl_cipher_list = buffer_init(); 
     168                s->ssl_use_sslv2 = 0; 
    165169                s->max_keep_alive_requests = 16; 
    166170                s->max_keep_alive_idle = 5; 
     
    220224 
    221225                cv[50].destination = &(s->max_connection_idle); 
     226                cv[52].destination = s->ssl_cipher_list; 
     227                cv[53].destination = &(s->ssl_use_sslv2); 
    222228 
    223229                srv->config_storage[i] = s; 
     
    290296        PATCH(ssl_pemfile); 
    291297        PATCH(ssl_ca_file); 
     298        PATCH(ssl_cipher_list); 
     299        PATCH(ssl_use_sslv2); 
    292300        return 0; 
    293301} 
     
    341349                        } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.engine"))) { 
    342350                                PATCH(is_ssl); 
     351                        } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.cipher-list"))) { 
     352                                PATCH(ssl_cipher_list); 
     353                        } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.use-sslv2"))) { 
     354                                PATCH(ssl_use_sslv2); 
    343355#ifdef HAVE_LSTAT 
    344356                        } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.follow-symlink"))) { 
  • trunk/src/network.c

    r2029 r2036  
    486486                        return -1; 
    487487                } 
    488  
     488                 
     489                if (!s->ssl_use_sslv2) { 
     490                        /* disable SSLv2 */ 
     491                        if (SSL_OP_NO_SSLv2 != SSL_CTX_set_options(s->ssl_ctx, SSL_OP_NO_SSLv2)) { 
     492                                log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:", 
     493                                                ERR_error_string(ERR_get_error(), NULL)); 
     494                                return -1; 
     495                        } 
     496                } 
     497                 
     498                if (!buffer_is_empty(s->ssl_cipher_list)) { 
     499                        if (SSL_CTX_set_cipher_list(s->ssl_ctx, s->ssl_cipher_list->ptr) != 1) { 
     500                                log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:", 
     501                                                ERR_error_string(ERR_get_error(), NULL)); 
     502                                return -1; 
     503                        } 
     504                } 
     505                 
    489506                if (buffer_is_empty(s->ssl_pemfile)) { 
    490507                        log_error_write(srv, __FILE__, __LINE__, "s", "ssl.pemfile has to be set");