Hướng dẫn chuyển đổi từ nginx x.509 sang pfx iis năm 2024

Website certificate website.crt Website privatekey website.key Intermediate certificate inter.crt Root CA certificate rootca.crt

Một số certificate cần cho quá trình cài đặt

  • GlobalSign Intermediate AlphaSSL
  • GlobalSign Intermediate DVSSL
  • GlobalSign Intermediate OVSSL
  • GlobalSign Intermediate EVSSL
  • GlobalSign Root AlphaSSL/DV/OV
  • GlobalSign Root EV
  • LetsEncrypt Intermediate
  • LetsEncrypt Root X3

Trong một số trường hợp cần cấu hình thêm dhparam.pem ⇒ Tạo ra bằng command sau

openssl dhparam -out dhparam.pem 2048

1.cPanel hosting

  • Đăng nhập vào trang quản trị web hosting

//:2083/

  • Chuyển tới mục Security > SSL/TLS
  • Trong mục “Install and Manage SSL for your site [HTTPS]”, click vào “Manage SSL sites.”
  • Tại màn hình “Install an SSL Website”, chọn domain cần cài đặt SSL từ combo box, điền thông tin tương ứng vào 3 text box bên dưới rồi click “Install Certificate”
    • Certificate của website [CRT]
    • Private của website [KEY]
    • Certificate Authority Bundle [CABUNDLE]

2.Plesk hosting

  • Đăng nhập vào trang quản trị hosting

//:8443/

  • Trong mục Websites & Domains, chuyển tới website cần cài đặt SSL và chọn “SSL/TLS Certificates”
  • Click nút “Add SSL/TLS Certificate”
  • Cung cấp thông tin về certificate cần cài đặt [upload file hoặc paste nội dung], bao gồm:
    • Private key của website
    • Certificate của website
    • CA Certificate
  • Click “Upload Certificate” để xác nhận và cài đặt SSL

3.Web server Apache

Cấu hình như sau vào virtualhost https

    SSLEngine on  
    SSLCertificateFile /etc/ssl/certs/website.crt  
    SSLCertificateKeyFile /etc/ssl/certs/website.key  
    SSLCertificateChainFile /etc/ssl/certs/chain.crt  
    SSLCipherSuite AES256+EECDH:AES256+EDH:AES128+EECDH:AES128+EDH  
    
# SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!SSLv3:!SSLv2
    SSLProtocol ALL -SSLv2 -SSLv3 +TLSv1 +TLSv1.1 +TLSv1.2  
    SSLHonorCipherOrder on  

Cấu hình HSTS

Header always set Strict-Transport-Security "max-age=63072000;"

Cấu hình HPKP Header

Header set Public-Key-Pins "pin-sha256=\"cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=\"; pin-sha256=\"M8HztCzM3elUxkcjR2S5P4hhyBNf6lHkmjAHKhpGPWE=\"; max-age=5184000; includeSubDomains; report-uri=\"//www.example.org/hpkp-report\""

4.Web server Nginx

Cấu hình như sau vào virtualhost https

ssl_certificate /etc/ssl/certs/website_inter.crt; ssl_certificate_key /etc/ssl/certs/website.key;

Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits

ssl_dhparam /etc/ssl/certs/dhparam.pem;

enables server-side protection from BEAST attacks ## //blog.ivanristic.com/2013/09/is-beast-still-a-threat.html

ssl_prefer_server_ciphers on;

disable SSLv3[enabled by default since nginx 0.8.19] since it's less secure then TLS //en.wikipedia.org/wiki/Secure_Sockets_Layer

SSL_3.0

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

ciphers chosen for forward secrecy and compatibility ## //blog.ivanristic.com/2013/08/configuring-apache-nginx-and-openssl-for-forward-secrecy.html

ssl_ciphers HIGH:!aNULL:!MD5; # avoid weak ciphersuite

enable session resumption to improve https performance ## //vincent.bernat.im/en/blog/2011-ssl-session-reuse-rfc5077.html

ssl_session_cache shared:SSL:50m; ssl_session_timeout 1d; ssl_session_tickets off;

enable ocsp stapling [mechanism by which a site can convey certificate revocation information to visitors in a privacy-preserving, scalable manner]

//blog.mozilla.org/security/2013/07/29/ocsp-stapling-in-firefox/

resolver 8.8.8.8 8.8.4.4; ssl_stapling on; ssl_stapling_verify on; ssl_trusted_certificate /etc/nginx/ssl/website_inter.crt;

config to enable HSTS[HTTP Strict Transport Security] //developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security

to avoid ssl stripping //en.wikipedia.org/wiki/SSL_stripping

SSL_stripping

also //hstspreload.org/

add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload";

5.Ứng dụng nền tảng Java

Tham khảo Hướng dẫn cài đặt SSL cho server Java [keystore]

Windows IIS

Tạo certificate PFX

openssl pkcs12 -export -in website.crt -inkey website.key -chain -CAfile chain.crt -name "domain" -out website.pfx

Hoặc

openssl pkcs12 -export -out name.pfx -inkey key.key -in key.crt -certfile ev.crt -passout pass:tenten

Chú ý:

  • //:8443/ 3: Đường dẫn Private Key
  • //:8443/ 4: Đường dẫn Certificate file
  • //:8443/ 5: Đường dẫn Intermediate theo từng gói
  • //:8443/ 6: Password bảo vệ. Mặc định: //:8443/ 7.

Chuyển đổi từ *.PEM [khi sử dụng SSL Let’s Enscypt] sang PFX

openssl pkcs12 -export -out certificate-full.pfx -inkey privkey1.pem -in cert1.pem -certfile fullchain1.pem

Script tự động gen PFX: [Với GlobalSign]

//:2083/

0

Chú ý:

  • Tạo 1 file chứa Cert. và PK vào file có phần mở rộng là //:8443/ 8
  • Chọn Intermediate tương ứng: //:8443/ 9

Import vào server

  • Vào giao diện quản trị IIS
  • Chọn WebServer trong khung bên trái
  • Chọn mục Server Certificates trong khung bên phải
  • Click Import… và trỏ tới file .pfx đã chuẩn bị, nhập password bảo vệ, nhớ tick chọn mục Allow export

Cấu hình website https

  • Vào giao diện quản trị IIS
  • Chọn website cần thiết lập https từ khung bên trái
  • Click Bindings… và thiết lập port 443 cho tên miền và certificate tương ứng [chọn từ list các certificate đã import vào server]

6.Zimbra

Tham khảo Cấu hình SSL certificate cho Zimbra

OpenSSL help

Xem thông tin certificate

//:2083/

1

Xem thông tin CSR

//:2083/

2

Generate private key kèm theo CSR

//:2083/

3

Generate key kèm theo self-signed certificate

//:2083/

4

Generate CSR từ private đã có

//:2083/

5

Bỏ mật khẩu của private key

//:2083/

6

Convert PKCS7 ⇒ PEM

//:2083/

7

Convert PFX ⇒ PEM

//:2083/

8

Kiểm tra hash MD5 của certificate, CSR hoặc private key

//:2083/

9

Lấy encode Base64 của pubkey

Dùng cho cấu hình HPKP Header [Public-Key-Pins]

Sử dụng một trong 4 lệnh sau, tùy thuộc thông tin input là pubkey, CSR, hay privatekey [ECC hoặc RSA]

Chủ Đề