【问题标题】:SSL_CTX_set_cipher_list() does not have affectSSL_CTX_set_cipher_list() 没有影响
【发布时间】:2019-09-09 15:32:15
【问题描述】:

我正在为我用 C 开发的服务器使用 OpenSSL。

OpenSSL 在我的源代码中是通过以下方式调用的:

SSL_CTX* InitServerCTX(void)
{
    SSL_METHOD *method;
    SSL_CTX *ctx;

    OpenSSL_add_all_algorithms();  /* load & register all cryptos, etc. */
    SSL_load_error_strings();   /* load all error messages */
    method = TLSv1_2_server_method();  /* create new server-method instance */
    ctx = SSL_CTX_new(method);   /* create new context from method */
    if ( ctx == NULL )
    {
        ERR_print_errors_fp(stderr);
        abort();
    }
    return ctx;
}

int main(int count, char *Argc[])
{   
    SSL_CTX *ctx;
    int server;
    char *portnum;

    // Initialize the SSL library
    SSL_library_init();
    ctx = InitServerCTX();        /* initialize SSL */
    ...
}

我用ssllabs.com 测试了我的服务器。而且我的服务器上支持的密码很弱。

我尝试在启动上下文后添加以下行

SSL_CTX_set_cipher_list(ctx, "ALL:!NULL-MD5:!NULL-SHA:!NULL-RSA");

但没有任何改变!

如何在我的服务器中禁用这些弱密码?

【问题讨论】:

    标签: c++ c security ssl openssl


    【解决方案1】:
     SSL_CTX_set_cipher_list(ctx, "ALL:!NULL-MD5:!NULL-SHA:!NULL-RSA");
    

    此密码设置不会禁用典型的弱密码。相反:这实际上启用了所有密码(由于 ALL),包括许多弱密码,并且只禁用了极少数 NULL 密码。

    至少你应该使用HIGH 而不是ALL。更好的建议可以在at the Mozilla server configuration找到。

    【讨论】:

    猜你喜欢
    • 2020-09-06
    • 1970-01-01
    • 2019-03-18
    • 2020-11-10
    • 2015-11-04
    • 2010-12-01
    • 2020-07-09
    • 2013-10-07
    • 2021-12-15
    相关资源
    最近更新 更多