Chứng chỉ SSL/TLS cho HTTPS listener (SNI)
Mỗi tên miền dùng HTTPS cần một chứng chỉ; khi nhiều tên miền dùng chung một load balancer, cần cách để trả đúng chứng chỉ cho từng tên miền.
MFTECH tách hệ thống thành các microservice sau một ALB: checkout.mftech.vn, www.mftech.vn, cùng mftech.com.vn/profile và mftech.com.vn/search của thương hiệu thứ hai. Mọi URL phải dùng HTTPS. Đội vận hành cân nhắc bốn thiết lập: một chứng chỉ wildcard, danh sách nhiều chứng chỉ chọn bằng SNI, chuyển hướng HTTP sang HTTPS, và đổi security policy. Mỗi thiết lập giải quyết một vấn đề khác nhau; thay đổi từng thiết lập và quan sát kết quả của mọi client:
Yêu cầu: mọi URL của MFTECH chạy HTTPS trên một ALB, với cấu hình tối thiểu.
https://checkout.mftech.vn/Trình duyệt (TLS 1.3)Lỗi chứng chỉKhông chứng chỉ nào khớpcheckout.mftech.vn; ALB trả về default certificatewww.mftech.vnvà trình duyệt báo lỗi chứng chỉ.https://www.mftech.vn/Trình duyệt (TLS 1.3)HTTPS · TLS 1.3Chứng chỉwww.mftech.vnkhớpwww.mftech.vn.https://mftech.com.vn/profileTrình duyệt (TLS 1.3)Lỗi chứng chỉKhông chứng chỉ nào khớpmftech.com.vn; ALB trả về default certificatewww.mftech.vnvà trình duyệt báo lỗi chứng chỉ.https://mftech.com.vn/searchTrình duyệt (TLS 1.3)Lỗi chứng chỉKhông chứng chỉ nào khớpmftech.com.vn; ALB trả về default certificatewww.mftech.vnvà trình duyệt báo lỗi chứng chỉ.http://www.mftech.vn/Người dùng gõ http://HTTP, không mã hoáListener :80 chuyển tiếp request tới target group; trang được tải qua HTTP, dữ liệu không được mã hoá khi truyền. Cần default rule redirect sang HTTPS.https://checkout.mftech.vn/Máy POS cũ (chỉ TLS 1.0)Handshake thất bạiSecurity policyELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09chỉ chấp nhận TLS 1.3 và TLS 1.2; thiết bị chỉ hỗ trợ TLS 1.0 không thương lượng được kết nối. Chứng chỉ không liên quan tới lỗi này.
Trình duyệt truy cập được qua HTTPS hợp lệ: 1/5 URL.
Listener HTTPS luôn có một default certificate. Khi bổ sung certificate list, ALB dùng SNI để chọn chứng chỉ khớp tên miền client yêu cầu; default certificate chỉ được dùng khi client không gửi SNI hoặc không chứng chỉ nào khớp. Chứng chỉ wildcard *.mftech.vn chỉ bảo vệ một cấp subdomain, không bảo vệ tên miền gốc mftech.vn hay một tên miền khác như mftech.com.vn. Security policy là tổ hợp protocol và cipher dùng khi thương lượng TLS giữa client và ALB: tạo listener từ Console thì mặc định là ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09 (TLS 1.3 và 1.2), từ AWS CLI hoặc CloudFormation thì mặc định là ELBSecurityPolicy-2016-08 (TLS 1.0 tới 1.2).
- Nhiều tên miền khác nhau qua HTTPS trên một ALB với cấu hình tối thiểu: thêm chứng chỉ vào certificate list, ALB chọn bằng SNI.
- Wildcard chỉ phù hợp khi mọi tên miền là subdomain một cấp của cùng một tên miền.
- Redirect HTTP sang HTTPS chỉ buộc client dùng HTTPS; security policy chỉ quyết định protocol và cipher.
- Cả hai không thêm được tên miền nào vào listener.
SSL/TLS certificates for HTTPS listeners (SNI)
Every HTTPS domain needs a certificate; when many domains share one load balancer, it needs a way to present the right certificate for each.
MFTECH splits its system into microservices behind one ALB: checkout.mftech.vn, www.mftech.vn, plus mftech.com.vn/profile and mftech.com.vn/search for its second brand. Every URL must use HTTPS. The operations team considers four settings: one wildcard certificate, a list of certificates chosen by SNI, an HTTP to HTTPS redirect, and a different security policy. Each setting solves a different problem; change them one at a time and watch the result for every client:
Yêu cầu: mọi URL của MFTECH chạy HTTPS trên một ALB, với cấu hình tối thiểu.
https://checkout.mftech.vn/Trình duyệt (TLS 1.3)Lỗi chứng chỉKhông chứng chỉ nào khớpcheckout.mftech.vn; ALB trả về default certificatewww.mftech.vnvà trình duyệt báo lỗi chứng chỉ.https://www.mftech.vn/Trình duyệt (TLS 1.3)HTTPS · TLS 1.3Chứng chỉwww.mftech.vnkhớpwww.mftech.vn.https://mftech.com.vn/profileTrình duyệt (TLS 1.3)Lỗi chứng chỉKhông chứng chỉ nào khớpmftech.com.vn; ALB trả về default certificatewww.mftech.vnvà trình duyệt báo lỗi chứng chỉ.https://mftech.com.vn/searchTrình duyệt (TLS 1.3)Lỗi chứng chỉKhông chứng chỉ nào khớpmftech.com.vn; ALB trả về default certificatewww.mftech.vnvà trình duyệt báo lỗi chứng chỉ.http://www.mftech.vn/Người dùng gõ http://HTTP, không mã hoáListener :80 chuyển tiếp request tới target group; trang được tải qua HTTP, dữ liệu không được mã hoá khi truyền. Cần default rule redirect sang HTTPS.https://checkout.mftech.vn/Máy POS cũ (chỉ TLS 1.0)Handshake thất bạiSecurity policyELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09chỉ chấp nhận TLS 1.3 và TLS 1.2; thiết bị chỉ hỗ trợ TLS 1.0 không thương lượng được kết nối. Chứng chỉ không liên quan tới lỗi này.
Trình duyệt truy cập được qua HTTPS hợp lệ: 1/5 URL.
An HTTPS listener always has one default certificate. When you add a certificate list, the ALB uses SNI to pick the certificate that matches the domain name the client requests; the default certificate is used only when the client sends no SNI or no certificate matches. A wildcard certificate *.mftech.vn protects only one subdomain level; it does not protect the apex domain mftech.vn or a different domain such as mftech.com.vn. A security policy is the combination of protocols and ciphers used to negotiate TLS between the client and the ALB: a listener created in the console defaults to ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09 (TLS 1.3 and 1.2); one created with the AWS CLI or CloudFormation defaults to ELBSecurityPolicy-2016-08 (TLS 1.0 to 1.2).
- Several different domain names over HTTPS on one ALB with minimal configuration: add certificates to the certificate list and let the ALB choose by SNI.
- A wildcard fits only when every name is a one-level subdomain of the same domain.
- An HTTP to HTTPS redirect only forces clients onto HTTPS; a security policy only decides protocols and ciphers.
- Neither adds a domain name to the listener.