Chia Sẽ Kinh Nghiệm Về IT



Tìm Kiếm Với Google
-


Gởi Ðề Tài Mới  Gửi trả lời
 
Công Cụ Xếp Bài
Tuổi 19-07-2016, 03:39 PM   #1
hoctinhoc
Guest
 
Trả Lời: n/a
Hướng dẫn cách đăng ký và sử dụng SSL
Hướng dẫn cách đăng ký và sử dụng SSL

Để dùng được tính năng SSL (https) bạn thực hiện theo các bước sau:

1. Đặt chọn 1 nhà cung cấp SSL như: godaddy.com....

hoặc google search ssl

2. tạo File CSR

https://vn.godaddy.com/help/apache-g...g-request-5269

#openssl req -new -newkey rsa:2048 -nodes -keyout private.key -out www.quantrinet.com.csr


3. Gửi nội dung file CSR cho bên nhà cung cấp để họ tạo SSL cho mình

4. Bên nhà cung cấp SSL sẽ gửi lại mình 2 file SSL

- file certificate_key.crt (dung lượng tầm 2K)
- file intermediate_key.crt (dung lượng tầm 5K)


Kiểm tra SSL đã được cấp phát chưa


https://casecurity.ssllabs.com/analy...hideResults=on

5. Apply SSL vào Web Server

Tùy từng loại Web server mà nó hỗ trợ kiểu file khác nhau.

Bạn có thể chuyển đổi file này này thành các định dạng, crt, pem, ....

http://help.netmail.com/display/KB/C...+TO+DER+TO+PEM


- Chuyển SSL thành pem để Apply cho Node JS - Windows
B0: Vao linux go lenh phat SSL



openssl req -new -newkey rsa:2048 -nodes -keyout quantrinet.key -out quantrinet.csr


B1: copy noi dung cua cac file ssl vào 1 file



Lệnh Copy

cat www_example_com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > quantrinet.crt


thi du: quantrinet.crt

B2: convert file quantrinet.crt qua pem


openssl x509 -in quantrinet.crt -out quantrinet.der -outform DER

openssl x509 -in quantrinet.der -inform DER -out quantrinet.pem -outform PEM


B3: Convert Key to Pem


openssl rsa -in quantrinet.key -out quantrinet.key.pem -outform PEM

https://www.sslshopper.com/ssl-converter.html

6. Apply SSL vào Node JS


Nếu mua ở godday thì chọn download là Apache và Stype là Godday, đừng chọn là Macafee


http://tecadmin.net/setup-ssl-certif...-js-in-linux/#

=============================
var secure_port = 443;
var options = {
key: fs.readFileSync('private.pem'),
cert: fs.readFileSync('certificate.pem')
=============================

7. Trường họp Webserver của bạn đứng sau Haproxy bạn có thể tham khảo bài này để triển khai

hướng dẫn cấu hình HAproxy pass-through

https://serversforhackers.com/using-...s-with-haproxy


Trích dẫn:

frontend localhost
bind *:80
bind *:443
option tcplog
mode tcp
default_backend nodes

Trích dẫn:
backend nodes
mode tcp
balance roundrobin
server web01 172.17.0.3:443 check
server web02 172.17.0.4:443 check
Chúc các bạn thành công!
  Trả lời ngay kèm theo trích dẫn này
Gửi trả lời


Công Cụ
Xếp Bài

Quyền Hạn Của Bạn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Hình Cảm xúc đang Mở
[IMG] đang Mở
Mã HTML đang Tắt




Bây giờ là 06:16 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.