Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 在Greenlock Express中禁用TLS 1.0和TLS 1.1_Node.js_Express_Ssl_Tls1.2_Greenlock - Fatal编程技术网

Node.js 在Greenlock Express中禁用TLS 1.0和TLS 1.1

Node.js 在Greenlock Express中禁用TLS 1.0和TLS 1.1,node.js,express,ssl,tls1.2,greenlock,Node.js,Express,Ssl,Tls1.2,Greenlock,有没有办法禁用TLS 1.0和TLS 1.1,只允许TLS 1.2与Greenlock Express和Node.js一起使用 Greenlock的示例代码如下所示: var app = require("./app"); require("greenlock-express") .init({ packageRoot: __dirname, configDir: "./greenlock.d",

有没有办法禁用TLS 1.0和TLS 1.1,只允许TLS 1.2与Greenlock Express和Node.js一起使用

Greenlock的示例代码如下所示:

var app = require("./app");

require("greenlock-express")
  .init({
     packageRoot: __dirname,
     configDir: "./greenlock.d",

     maintainerEmail: "email@example.com",

     cluster: false
})
.serve(app);
其中
app
是Express server对象

服务器TLS选项可以通过Greenlock初始化参数传递吗?

使用
.ready()
而不是
.serve()
,您可以访问节点的本机
https
对象,并根据需要进行自定义

.ready(函数(glx){
//获取原始https服务器:
var tlsOptions={};
var httpsServer=glx.httpsServer(tls选项,函数(req,res){
res.end(“你好,加密世界!”);
});
httpsServer.listen(443,“0.0.0.0”,function(){
console.info(“监听”,httpsServer.address());
});
})