|
||||||||
|
||||||||
|
|
Công Cụ | Xếp Bài |
18-08-2021, 05:12 PM | #1 | ||||||||||||||||||||
Guest
Trả Lời: n/a
|
Hướng dẫn cài đặt ssl let's encrypt trên Node JS
Hướng dẫn cài đặt ssl let's encrypt trên Node JS
[IMG]https://miro.medium.com/max/1400/1*tuufwZ37Yd0ialLOmr4aPg.jpeg[/IMG] HTTPS is the basic security setting for all websites. To enable HTTPS and avoid the annoying “certificate not trusted error” on browsers, you need to get a certificate from a trusted issuer and install it on your server. Let’s Encrypt is a free, automated, and open Certificate Authority. With letsencrypt, you can secure your server with HTTPS for free. In this post, I will introduce how to secure your nodejs server with letsencrypt-express (now renamed to greenlock-express). Although there is an express in the name, you can still use it in your non-express nodejs server. First, let’s create a test server:
Next, you need to enable HTTPS by starting an https server:
Now use letsencrypt-express (greenlock-express) to create a handler wrapper: (2018–05–20: the following code has been updated to support Let’s Encrypt v2)
The returned object middlewareWrapper is a function, which takes any handler with the following form, and returns a middleware with the same form:
Tham khảo: https://medium.com/@bohou/secure-you...e-f8925742faa9 |
||||||||||||||||||||
|
|