简体   繁体   English

在 Greenlock-Express 中禁用 TLS 1.0 和 TLS 1.1

[英]Disable TLS 1.0 and TLS 1.1 in Greenlock-Express

Is there a way to disable TLS 1.0 and TLS 1.1 and only allow TLS 1.2 with Greenlock-Express and Node.js?有没有办法禁用 TLS 1.0 和 TLS 1.1 并且只允许使用 Greenlock-Express 和 Node.js 的 TLS 1.2?

The example code for Greenlock shows something like the following: Greenlock 的示例代码如下所示:

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

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

     maintainerEmail: "email@example.com",

     cluster: false
})
.serve(app);

where app is the Express server object.其中app是 Express 服务器 object。

Can server TLS options be passed through the Greenlock initialization parameters?服务器 TLS 选项可以通过 Greenlock 初始化参数传递吗?

Use .ready() instead of .serve() and you can get access to node's native https object customize as you wish.使用.ready()而不是.serve() ,您可以根据需要访问节点的本机https object 自定义。

.ready(function (glx) {
    // Get the raw https server:
    var tlsOptions = {};
    var httpsServer = glx.httpsServer(tlsOptions, function(req, res) {
        res.end("Hello, Encrypted World!");
    });

    httpsServer.listen(443, "0.0.0.0", function() {
        console.info("Listening on ", httpsServer.address());
    });
})

See examples/https/server.js .请参阅示例/https/server.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM