带有自签名证书的 SSL 握手失败
SSL handshake failure w/ self-signed certificates
当我从终端 运行 curl -k https://localhost:8080/
时,出现以下错误:
curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
代码:(语言是 coffeescript)
https = require 'https'
fs = require 'fs'
options =
key: fs.readFileSync('server.key')
cert: fs.readFileSync('server.crt')
requestCert: false
rejectUnauthorized: false
server = https.createServer(options,
(req, res) =>
console.log "TEST"
)
server.listen(process.env.PORT, process.env.IP)
其他信息:
我 运行 在 Cloud9 的 UNIX 机器上安装这些。
证书是免费的、自签名的东西。
发件人:http://www.akadia.com/services/ssh_test_certificate.html、
"During the generation of the CSR, you will be prompted for several pieces of information. These are the X.509 attributes of the certificate. One of the prompts will be for "通用名称(例如,您的姓名)”。请务必在此字段中填写要受 SSL 保护的服务器的完全限定域名。如果要保护的网站是https://public.akadia.com,那么在这个提示符下输入public.akadia.com。
证书中的 "Common Name" 与您正在 curl
的 URL 之间的不匹配将导致您遇到的问题!尝试使用 "Common Name" 重新生成您的证书作为您的 完全指定 URL.
当我从终端 运行 curl -k https://localhost:8080/
时,出现以下错误:
curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
代码:(语言是 coffeescript)
https = require 'https'
fs = require 'fs'
options =
key: fs.readFileSync('server.key')
cert: fs.readFileSync('server.crt')
requestCert: false
rejectUnauthorized: false
server = https.createServer(options,
(req, res) =>
console.log "TEST"
)
server.listen(process.env.PORT, process.env.IP)
其他信息: 我 运行 在 Cloud9 的 UNIX 机器上安装这些。 证书是免费的、自签名的东西。
发件人:http://www.akadia.com/services/ssh_test_certificate.html、
"During the generation of the CSR, you will be prompted for several pieces of information. These are the X.509 attributes of the certificate. One of the prompts will be for "通用名称(例如,您的姓名)”。请务必在此字段中填写要受 SSL 保护的服务器的完全限定域名。如果要保护的网站是https://public.akadia.com,那么在这个提示符下输入public.akadia.com。
证书中的 "Common Name" 与您正在 curl
的 URL 之间的不匹配将导致您遇到的问题!尝试使用 "Common Name" 重新生成您的证书作为您的 完全指定 URL.