diff options
Diffstat (limited to 'vchat-ssl.c')
-rwxr-xr-x | vchat-ssl.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/vchat-ssl.c b/vchat-ssl.c index 2b41432..64886ca 100755 --- a/vchat-ssl.c +++ b/vchat-ssl.c | |||
@@ -61,8 +61,7 @@ SSL_CTX * vc_create_sslctx( vc_x509store_t *vc_store ) | |||
61 | X509_STORE *store = NULL; | 61 | X509_STORE *store = NULL; |
62 | vc_x509verify_cb_t verify_callback = NULL; | 62 | vc_x509verify_cb_t verify_callback = NULL; |
63 | 63 | ||
64 | /* Explicitly use TLSv1_2 (or maybe later) */ | 64 | if( !(ctx = SSL_CTX_new(SSLv23_method())) ) |
65 | if( !(ctx = SSL_CTX_new(TLSv1_2_client_method())) ) | ||
66 | VC_CTX_ERR_EXIT(store, ctx); | 65 | VC_CTX_ERR_EXIT(store, ctx); |
67 | 66 | ||
68 | if( !(store = vc_x509store_create(vc_store)) ) | 67 | if( !(store = vc_x509store_create(vc_store)) ) |
@@ -70,9 +69,11 @@ SSL_CTX * vc_create_sslctx( vc_x509store_t *vc_store ) | |||
70 | 69 | ||
71 | SSL_CTX_set_cert_store(ctx, store); | 70 | SSL_CTX_set_cert_store(ctx, store); |
72 | store = NULL; | 71 | store = NULL; |
73 | /* Disable A LOT of insecure protocols explicitly */ | 72 | SSL_CTX_set_options(ctx, SSL_OP_ALL | SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); |
74 | SSL_CTX_set_options(ctx, SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1); | 73 | if( OPENSSL_VERSION_NUMBER < 0x10000000L ) |
75 | SSL_CTX_set_cipher_list(ctx, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"); | 74 | SSL_CTX_set_cipher_list(ctx, "DHE-RSA-AES256-SHA"); |
75 | else | ||
76 | SSL_CTX_set_cipher_list(ctx, "ECDHE-RSA-AES256-GCM-SHA384"); | ||
76 | 77 | ||
77 | SSL_CTX_set_verify_depth (ctx, 2); | 78 | SSL_CTX_set_verify_depth (ctx, 2); |
78 | 79 | ||