Changeset 1799


Ignore:
Timestamp:
Feb 15, 2008 8:08:06 AM (16 years ago)
Author:
bennylp
Message:

Ticket #481: Default TLS version should be TLSv1 (thanks Klaus Darilion)

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_transport_tls.h

    r974 r1799  
    4040 */ 
    4141 
     42/** 
     43 * The default SSL method to be used by PJSIP. 
     44 * Default is PJSIP_TLSV1_METHOD 
     45 */ 
     46#ifndef PJSIP_SSL_DEFAULT_METHOD 
     47#   define PJSIP_SSL_DEFAULT_METHOD     PJSIP_TLSV1_METHOD 
     48#endif 
     49 
    4250/** SSL protocol method constants. */ 
    4351typedef enum pjsip_ssl_method 
    4452{ 
    45     PJSIP_SSL_DEFAULT_METHOD    = 0,    /**< Default protocol method.   */ 
    46     PJSIP_TLSV1_METHOD          = 1,    /**< Use SSLv1 method.          */ 
    47     PJSIP_SSLV2_METHOD          = 2,    /**< Use SSLv2 method.          */ 
    48     PJSIP_SSLV3_METHOD          = 3,    /**< Use SSLv3 method.          */ 
     53    PJSIP_SSL_UNSPECIFIED_METHOD= 0,    /**< Default protocol method.   */ 
     54    PJSIP_TLSV1_METHOD          = 31,   /**< Use SSLv1 method.          */ 
     55    PJSIP_SSLV2_METHOD          = 20,   /**< Use SSLv2 method.          */ 
     56    PJSIP_SSLV3_METHOD          = 30,   /**< Use SSLv3 method.          */ 
    4957    PJSIP_SSLV23_METHOD         = 23    /**< Use SSLv23 method.         */ 
    5058} pjsip_ssl_method; 
     59 
     60 
    5161 
    5262 
     
    8090    /** 
    8191     * TLS protocol method from #pjsip_ssl_method, which can be: 
    82      *  - PJSIP_SSL_DEFAULT_METHOD(0):  default (which will use SSLv23) 
    83      *  - PJSIP_TLSV1_METHOD(1):        TLSv1 
    84      *  - PJSIP_SSLV2_METHOD(2):        TLSv2 
    85      *  - PJSIP_SSLV3_METHOD(3):        TLSv3 
    86      *  - PJSIP_SSLV23_METHOD(23):      TLSv23 
    87      * 
    88      * Default is PJSIP_SSL_DEFAULT_METHOD (0), which will use SSLv23 
    89      * protocol method. 
     92     *  - PJSIP_SSL_UNSPECIFIED_METHOD(0): default (which will use  
     93     *                                     PJSIP_SSL_DEFAULT_METHOD) 
     94     *  - PJSIP_TLSV1_METHOD(1):           TLSv1 
     95     *  - PJSIP_SSLV2_METHOD(2):           SSLv2 
     96     *  - PJSIP_SSLV3_METHOD(3):           SSL3 
     97     *  - PJSIP_SSLV23_METHOD(23):         SSL23 
     98     * 
     99     * Default is PJSIP_SSL_UNSPECIFIED_METHOD (0), which in turn will 
     100     * use PJSIP_SSL_DEFAULT_METHOD, which default value is  
     101     * PJSIP_TLSV1_METHOD. 
    90102     */ 
    91103    int         method; 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c

    r1611 r1799  
    316316{ 
    317317    struct pjsip_tls_setting *opt = &lis->setting; 
     318    int method; 
    318319    char *lis_name = lis->factory.obj_name; 
    319320    SSL_METHOD *ssl_method; 
     
    327328 
    328329    /* Determine SSL method to use */ 
    329     switch (opt->method) { 
    330     case PJSIP_SSL_DEFAULT_METHOD: 
     330    method = opt->method; 
     331    if (method == PJSIP_SSL_UNSPECIFIED_METHOD) 
     332        method = PJSIP_SSL_DEFAULT_METHOD; 
     333 
     334    switch (method) { 
    331335    case PJSIP_SSLV23_METHOD: 
    332336        ssl_method = SSLv23_method(); 
Note: See TracChangeset for help on using the changeset viewer.