Django管理员登录SSL_do_handshake()失败



在登录django网站的管理页面时,我在nginx错误日志中得到了以下内容

2022/01/28 17:04:50 [crit] 22184#22184: *263 SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking, client: 107.178.232.184, server: 0.0.0.0:443
2022/01/28 17:08:12 [crit] 22184#22184: *277 SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking, client: 107.178.239.221, server: 0.0.0.0:443
2022/01/28 17:08:30 [crit] 22184#22184: *288 SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking, client: 107.178.232.251, server: 0.0.0.0:443
2022/01/28 17:10:09 [crit] 22184#22184: *302 SSL_do_handshake() failed (SSL: error:14201044:SSL routines:tls_choose_sigalg:internal error) while SSL handshaking, client: 45.56.98.215, server: 0.0.0.0:443
2022/01/28 17:28:03 [crit] 22184#22184: *344 SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking, client: 165.227.140.0, server: 0.0.0.0:443

一个可能的原因是我没有制作django项目时使用的密钥,因为我丢失了.env文件。我用这个答案生成了一个密钥并存储在.env文件中。这可能是原因吗?或者还有其他原因吗?

密钥没有问题。我在生产中短暂地保持了Debug=True,以找出出了什么问题,我得到了错误

AssertionError: database connection isn't set to UTC

这是由于psycopg2 2.9>Django 2.2.x发现了这个答案并解决了这个问题。

最新更新