我将 WorkerRole 配置为通过 csdef 中的 Runtime/EntryPoint/ProgramEntryPoint 元素启动 node.exe,并为端口 443 上的 https 配置了 HttpsIn EndPoint(带有有效证书)。我还在运行时/环境中设置 PORT 环境变量, Node 使用该变量来监听传入请求。
当我启动服务(在本地开发结构或 Azure 中)并尝试访问该服务时,出现以下错误:
SSL connection error
Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.
Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.
我已经验证node.exe确实在服务启动时启动,如果我在计算模拟器中查找本地端口,通常类似于:
http://localhost:444
我可以使用浏览器直接成功访问 Node 。当未配置 SSL 时,我还可以通过 Azure 访问 Node 。
我错过了什么?谢谢!
最佳答案
问题是我在 Node.js 中启动 Web 服务器时使用的是 http 模块而不是 https 模块。当我使用 ssl 证书启动 https 服务器后,就可以工作了。
我正在遵循 WebRole 中的 SSL w/Node 指南,该指南需要与 WorkerRole 中的 SSL w/Node 不同的设置。
关于javascript - 带 SSL 的 Azure 辅助角色上的 Node.js 会导致 ERR_SSL_PROTOCOL_ERROR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12645561/