mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-11-03 04:17:17 -05:00
Cleanup: Simplify adding SSL_OP_NO_COMPRESSION
This commit is contained in:
parent
ed9a4e658c
commit
14ba90fc93
@ -81,12 +81,12 @@ tls_ctx_t *tls_ctx_new(const char *cert_file, const char *key_file, const char *
|
|||||||
ctx->ctx = SSL_CTX_new(SSLv23_server_method());
|
ctx->ctx = SSL_CTX_new(SSLv23_server_method());
|
||||||
|
|
||||||
ssl_opts = SSL_CTX_get_options(ctx->ctx);
|
ssl_opts = SSL_CTX_get_options(ctx->ctx);
|
||||||
|
ssl_opts |= SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3; // Disable SSLv2 and SSLv3
|
||||||
#ifdef SSL_OP_NO_COMPRESSION
|
#ifdef SSL_OP_NO_COMPRESSION
|
||||||
SSL_CTX_set_options(ctx->ctx, ssl_opts|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_COMPRESSION);
|
ssl_opts |= SSL_OP_NO_COMPRESSION; // Never use compression
|
||||||
#else
|
|
||||||
SSL_CTX_set_options(ctx->ctx, ssl_opts|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
SSL_CTX_set_options(ctx->ctx, ssl_opts);
|
||||||
do {
|
do {
|
||||||
if (SSL_CTX_use_certificate_chain_file(ctx->ctx, cert_file) <= 0) {
|
if (SSL_CTX_use_certificate_chain_file(ctx->ctx, cert_file) <= 0) {
|
||||||
ICECAST_LOG_WARN("Invalid cert file %s", cert_file);
|
ICECAST_LOG_WARN("Invalid cert file %s", cert_file);
|
||||||
|
Loading…
Reference in New Issue
Block a user