dpgkg42484
2015-06-08 04:47
浏览 131
已采纳

SSL操作失败,代码1:dh键太小

I am connecting to my database Google Cloud SQL via SSL. I use codeigniter 3.0 to do so, although the mysqli driver is a bit modified to allow this functionality.

It's been working well for months. However it just started to return this warning:

Message: mysqli::real_connect(): SSL operation failed with code 1. OpenSSL Error messages: error:14082174:SSL routines:SSL3_CHECK_CERT_AND_ALGORITHM:dh key too small

I'm assuming DH Key is too small is the main problem, but I have no idea what that means. I've googled Diffie–Hellman key exchange, along with the message "key too small" but I haven't had much luck.

Is this a sign that the keys on the server have been tampered with? I've checked the last-modified dates on them -- no abnormal recent access.

It could be that my server did some upgrading to PHP or their server configuration, which may result in this breaking, but I wanted to check and make sure that it wasn't something else.

Thanks for any insight / readable material on the subject.

图片转代码服务由CSDN问答提供 功能建议

我通过SSL连接到我的数据库Google Cloud SQL。 虽然mysqli驱动程序有点修改以允许此功能,但我使用codeigniter 3.0来执行此操作。

它已经好几个月了。 但是只是开始返回此警告:

 消息:mysqli :: real_connect():SSL操作失败,代码为1. OpenSSL错误消息: 错误:14082174:SSL例程:SSL3_CHECK_CERT_AND_ALGORITHM:dh键太小
   
 
 

我假设 DH键太小是主要问题 ,但我不知道这意味着什么。 我用Google搜索了Diffie-Hellman密钥交换,以及“密钥太小”的消息,但我没有太多运气。

这是否表示服务器上的密钥已被篡改? 我已经检查了它们上次修改的日期 - 没有异常的最近访问权限。

可能是我的服务器做了一些升级到PHP或它们的服务器配置,这可能导致这个 打破,但我想检查并确保它不是别的。

感谢有关该主题的任何见解/可读材料。

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dsuoedtom207012191 2015-06-08 10:34
    已采纳
    ... error:14082174:SSL routines:SSL3_CHECK_CERT_AND_ALGORITHM:dh key too small
    

    The error number you are interested in is the OpenSSL error 0x14082174.

    The SSL3_CHECK_CERT_AND_ALGORITHM is usually seen when enabling export grade ciphers. It may be showing up again in non-export grade negotiations due to Logjam (see below).


    I'm assuming DH Key is too small is the main problem, but I have no idea what that means. I've googled Diffie–Hellman key exchange, along with the message "key too small" but I haven't had much luck.

    That's due to the recent Logjam attack from the paper Imperfect Forward Secrecy: How Diffie-Hellman Fails in Practice.

    You should use 2048-bit Diffie-Hellman groups or larger. You should not be using 512-bit or 1024-bit Diffie-Hellman groups.

    The first thing to check for is your cipher list string. It should be similar to:

    "HIGH:!aNULL:!MD5:!RC4"
    

    It will avoid the export grade ciphers, and use modern ciphers. But you will also need to ensure your DH callback is not using a weak/small field size. For that, you need to check the server configuration.


    Some folks are "solving" the issue with kRSA. kRSA is a key transport scheme, not a key agreement scheme. The RSA key transport scheme does not provide forward secrecy, and its use is usually discouraged. In fact, its going to be removed from TLS 1.3.

    I can only say "usually discouraged" because it depends on the data being protected. If you have SSL/TLS to guard downloads of a publicly available file, then its probably OK to use. If your website has a login, then its probably a little risky to use it because the password is secret data (unlike the publicly downloadable file).

    To avoid key transport and pass those Qualsys SSL Labs tests for web server configurations and forward secrecy, use:

    "HIGH:!aNULL:!kRSA:!MD5:!RC4"
    

    In your Apache configuration file, it would look like so:

    # cat /etc/httpd/conf.d/ssl.conf | grep SSLCipherSuite
    # SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
    SSLCipherSuite HIGH:!aNULL:!kRSA:!MD5:!RC4
    

    I seem to recall wget rejected small groups quite some time before the paper was released. It might make a good test case for your site.

    There's also an improved sslscan, which tests for lots of things. That might make a good QA tool, too.

    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题