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: Trích dẫn:
Next, you need to enable HTTPS by starting an https server: Trích dẫn:
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) Trích dẫn:
The returned object middlewareWrapper is a function, which takes any handler with the following form, and returns a middleware with the same form: Trích dẫn:
Trích dẫn:
Tham khảo: https://medium.com/@bohou/secure-you...e-f8925742faa9 |
Bây giờ là 06:40 PM. Giờ GMT +7 |
Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.