我通过SSL连接到我的数据库Google Cloud SQL.虽然mysqli驱动程序有点修改以允许此功能,但我使用codeigniter 3.0来执行此操作.
它已经好几个月了.但是它刚刚开始返回此警告:
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
Run Code Online (Sandbox Code Playgroud)
我假设DH Key is too small是主要问题,但我不知道这意味着什么.我用Google搜索了Diffie-Hellman密钥交换,以及"密钥太小"的消息,但我没有太多运气.
这是服务器上的密钥被篡改的标志吗?我已经检查了它们的最后修改日期 - 没有异常的最近访问.
可能是我的服务器做了一些升级到PHP或他们的服务器配置,这可能导致这种破坏,但我想检查并确保它不是别的东西.
感谢您对该主题的任何见解/可读材料.
〜我正在使用Node 10.9.0和npm 6.2.0〜
我正在运行以下应用程序,该应用程序使我能够一遍http又一遍地向同一站点发出请求https。
var fetch = require('node-fetch')
const express = require('express')
const app = express()
//-- HTTP --
app.get('/test-no-ssl', function(req, res){
fetch('http://jsonplaceholder.typicode.com/users')
.then(res => res.json())
.then(users => {
res.send(users)
}).catch(function(error) {
res.send(error)
})
})
//-- HTTPS --
app.get('/test-ssl', function(req, res){
fetch('https://jsonplaceholder.typicode.com/users')
.then(res => res.json())
.then(users => {
res.send(users)
}).catch(function(error) {
res.send(error)
})
})
app.listen(3003, () =>
console.log('Listening on port 3003...')
)
Run Code Online (Sandbox Code Playgroud)
两者在我的本地计算机上都可以正常工作,并返回Typicode提供的JSON响应。但是,当我将它们作为Node应用程序部署到Web主机(FastComet)上时,会得到以下结果:
HTTP- /test-no-ssl按预期返回JSON
HTTPS- /test-ssl返回以下错误:
{
"message" : "request to …Run Code Online (Sandbox Code Playgroud)