Trong bài viết này sẽ sử dụng tên miền ảo làm ví dụ là site.test
Nội dung chính
- 1. Vào thư mục Apache trong XAMPP.
- 2. Tạo một thư mục mới.
- 3. Tải về và thêm 2 tập tin này vào thư mục vừa tạo
- 4. Sửa cert.conf và chạy make-cert.bat
- 5. Cài đặt chứng chỉ trong windows.
- 6. Thêm trang web trong máy chủ Windows
- 7. Thêm tên miền này vào file conf của XAMPP.
- 8. Khởi động lại trình duyệt và thử lại!
- Description
- Return Values
Nội dung chính
- 1. Vào thư mục Apache trong XAMPP.
- 2. Tạo một thư mục mới.
- 3. Tải về và thêm 2 tập tin này vào thư mục vừa tạo
- 4. Sửa cert.conf và chạy make-cert.bat
- 5. Cài đặt chứng chỉ trong windows.
- 6. Thêm trang web trong máy chủ Windows
- 7. Thêm tên miền này vào file conf của XAMPP.
- 8. Khởi động lại trình duyệt và thử lại!
- Description
- Return Values
1. Vào thư mục Apache trong XAMPP.
Mặc định XAMPP đợc cài đặt trong thư mục C:\xampp\apache.XAMPP đợc cài đặt trong thư mục C:\xampp\apache.
2. Tạo một thư mục mới.
3. Tải về và thêm 2 tập tin này vào thư mục vừa tạocrt ,Vì vậy, đường dẫn sẽ có dạng C:\xampp\apache\crt
3. Tải về và thêm 2 tập tin này vào thư mục vừa tạo
4. Sửa cert.conf và chạy make-cert.batcert.conf make-cert.bat về. 2 tập tin này sẽ dùng để tạo chứng chỉ SSL cho tên miền tùy thích.
4. Sửa cert.conf và chạy make-cert.bat
5. Cài đặt chứng chỉ trong windows.site.test và lưu lại.
6. Thêm trang web trong máy chủ Windowssite.test khi được nhắc. Và nhập trả lời cho các câu hỏi khác, thiết lập mặc định có sẵn trong cert.conf
5. Cài đặt chứng chỉ trong windows.
6. Thêm trang web trong máy chủ Windowsserver.crt and server.key. Đây là chứng chỉ SSL certificate.
7. Thêm tên miền này vào file conf của XAMPP.
8. Khởi động lại trình duyệt và thử lại!Local Machine trong Store Location.
DescriptionPlace all certificate in the following store” và click browse sau đó chọn Trusted Root Certification Authorities.
Return ValuesNext và Finish.
Mặc định XAMPP đợc cài đặt trong thư mục C:\xampp\apache.
6. Thêm trang web trong máy chủ Windows
- 7. Thêm tên miền này vào file conf của XAMPP.
- 8. Khởi động lại trình duyệt và thử lại!
- Description
127.0.0.1 site.test
Return Values
7. Thêm tên miền này vào file conf của XAMPP.
8. Khởi động lại trình duyệt và thử lại!C:\xampp\apache\conf\extra\httpd-xampp.conf
Description
## site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test SSLEngine on SSLCertificateFile "crt/site.test/server.crt" SSLCertificateKeyFile "crt/site.test/server.key"
Return Values
Mặc định XAMPP đợc cài đặt trong thư mục C:\xampp\apache.: Trong file conf XAMPP, bạn có thể thay đổi thư mục gốc cho từng tên miền nếu cần.
8. Khởi động lại trình duyệt và thử lại!
Description
Return Values
Mặc định XAMPP đợc cài đặt trong thư mục C:\xampp\apache.
Đây là nơi ta sẽ lưu trữ chứng chỉ SSL. Trong ví dụ này Ngôi Sao Số sẽ tạo thư mục crt ,Vì vậy, đường dẫn sẽ có dạng C:\xampp\apache\crt — Generates a CSR
Vào đường dẫn sau tải 2 tập tin cert.conf make-cert.bat về. 2 tập tin này sẽ dùng để tạo chứng chỉ SSL cho tên miền tùy thích.
Mở file cert.conf và thay đổi {{DOMAIN}} thành tên miền bạn muốn, trong trường hợp này site.test và lưu lại.: You need to have a valid openssl.cnf installed for this function to operate correctly. See the notes under the installation section for more information.
Nhấp đúp chuột vào make-cert.bat và nhập tên miền site.test khi được nhắc. Và nhập trả lời cho các câu hỏi khác, thiết lập mặc định có sẵn trong cert.conf
Sau đó, bạn sẽ thấy thư mục site.test được tạo. Trong thư mục đó ta sẽ có server.crt and server.key. Đây là chứng chỉ SSL certificate.Nhấp đúp chuột vào server.crt để cài đặt nó trên Windows để Windows chấp nhận chứng chỉ này.
Và chọn Local Machine trong Store Location.Tiếp tục chọn “Place all certificate in the following store” và click browse sau đó chọn Trusted Root Certification Authorities.openssl_pkey_new[] [or otherwise obtained from the other openssl_pkey family of functions]. The corresponding public portion of the key will be used to sign the CSR.
Chọn Next và Finish.Và bây giờ chứng chỉ này đã được cài đặt là tin cậy [trusted] trong Windows. Tiếp theo là làm thế nào để sử dụng chứng chỉ này trong XAMPP.
Mở notepad với quyền administrator.Và thêm dòng mới này dưới cùng: | Sau đó, bạn sẽ cần khởi động lại Apache trong XAMPP. Đơn giản, chỉ cần mở Bảng điều khiển XAMPP và bấm stop và start tại mục Apache. | Mẹo: Trong file conf XAMPP, bạn có thể thay đổi thư mục gốc cho từng tên miền nếu cần. | Cần khởi động lại trình duyệt để hệ thống tải chứng chỉ. Và truy cập tên miền trên trình duyệt của bạn, và bạn sẽ thấy khóa màu xanh lá như hình bên dưới!openssl_get_md_methods[] |
Ngôi Sao Số hy vọng hướng dẫn này hữu ích! | Sau đó, bạn sẽ cần khởi động lại Apache trong XAMPP. Đơn giản, chỉ cần mở Bảng điều khiển XAMPP và bấm stop và start tại mục Apache. | Ngôi Sao Số hy vọng hướng dẫn này hữu ích! | [PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8] |
openssl_csr_new — Generates a CSR | Sau đó, bạn sẽ cần khởi động lại Apache trong XAMPP. Đơn giản, chỉ cần mở Bảng điều khiển XAMPP và bấm stop và start tại mục Apache. | openssl_csr_new — Generates a CSR | Description |
private_key_bits | int | Default_bits | Chỉ định số lượng bit nên được sử dụng để tạo khóa riêng |
private_key_type | int | không ai | Chỉ định loại khóa riêng để tạo. Đây có thể là một trong số 5, 6, 7 hoặc 8. Giá trị mặc định là 7. 5, 6, 7 or 8. The default value is 7.
|
Encrypt_key | bool | Encrypt_key | bool |
Có nên mã hóa khóa được xuất [với cụm mật khẩu]? | int | không ai | Chỉ định loại khóa riêng để tạo. Đây có thể là một trong số 5, 6, 7 hoặc 8. Giá trị mặc định là 7. |
Encrypt_key | bool | không ai | Chỉ định loại khóa riêng để tạo. Đây có thể là một trong số 5, 6, 7 hoặc 8. Giá trị mặc định là 7.openssl_get_curve_names[].
|
Encrypt_key | bool | Có nên mã hóa khóa được xuất [với cụm mật khẩu]? | Encrypt_key_codes |
đường cong_name
sợi dây
Một trong các openSSL_GET_CURVE_NAME [].## site.test
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
SSLEngine on
SSLCertificateFile "crt/site.test/server.crt"
SSLCertificateKeyFile "crt/site.test/server.key"
4 on failure.
Cấu hình
8.0.0 | ## site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test SSLEngine on SSLCertificateFile "crt/site.test/server.crt" SSLCertificateKeyFile "crt/site.test/server.key"0OpenSSLCertificateSigningRequest instance now; previously, a resource of type ## site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test SSLEngine on SSLCertificateFile "crt/site.test/server.crt" SSLCertificateKeyFile "crt/site.test/server.key"5 was returned. |
8.0.0 | ## site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test SSLEngine on SSLCertificateFile "crt/site.test/server.crt" SSLCertificateKeyFile "crt/site.test/server.key"0 được sử dụng để chỉ định các tùy chọn cấu hình bổ sung cho CSR. Cả distinguished_names và ## site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test SSLEngine on SSLCertificateFile "crt/site.test/server.crt" SSLCertificateKeyFile "crt/site.test/server.key"0 đều là các mảng kết hợp có các khóa được chuyển đổi thành OID và áp dụng cho phần liên quan của yêu cầu.OpenSSLAsymmetricKey instance now; previously, a resource of type ## site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test SSLEngine on SSLCertificateFile "crt/site.test/server.crt" SSLCertificateKeyFile "crt/site.test/server.key"7 was accepted. |
7.1.0 | Trả về giá trị |
Trả về CSR hoặc ## site.test
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
SSLEngine on
SSLCertificateFile "crt/site.test/server.crt"
SSLCertificateKeyFile "crt/site.test/server.key"
4 khi thất bại.
Thay đổi
distinguished_names
0
Phiên bản
distinguished_names
1
Sự mô tả
- Về thành công, chức năng này trả về một thể hiện openSslCerTyerIgningRequest ngay bây giờ; Trước đây, một tài nguyên loại
## site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test DocumentRoot "C:/xampp/htdocs" ServerName site.test ServerAlias *.site.test SSLEngine on SSLCertificateFile "crt/site.test/server.crt" SSLCertificateKeyFile "crt/site.test/server.key"
5 đã được trả lại.
private_key
chấp nhận một phiên bản openSsmmetrickey ngay bây giờ; Trước đây, một tài nguyên loại ## site.test
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
SSLEngine on
SSLCertificateFile "crt/site.test/server.crt"
SSLCertificateKeyFile "crt/site.test/server.key"
7 đã được chấp nhận. ¶
options
bây giờ cũng hỗ trợ ## site.test
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
SSLEngine on
SSLCertificateFile "crt/site.test/server.crt"
SSLCertificateKeyFile "crt/site.test/server.key"
9.
distinguished_names
2
Ví dụ ¶
Ví dụ #1 Tạo chứng chỉ tự ký
distinguished_names
3
distinguished_names
4
distinguished_names
5Ví dụ #2 Tạo chứng chỉ ECC tự ký [kể từ Php 7.1.0] ¶
options
bây giờ cũng hỗ trợ ## site.test
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
SSLEngine on
SSLCertificateFile "crt/site.test/server.crt"
SSLCertificateKeyFile "crt/site.test/server.key"
9.
distinguished_names
6
distinguished_names
7
distinguished_names
8
distinguished_names
9
private_key
0
private_key
1
private_key
2
private_key
3
private_key
4
private_key
5
private_key
6
private_key
7
distinguished_names
5Ví dụ ¶
Ví dụ #1 Tạo chứng chỉ tự ký
private_key
9
private_key
0
private_key
1
private_key
2
private_key
3
Ví dụ #2 Tạo chứng chỉ ECC tự ký [kể từ Php 7.1.0]
private_key
5
distinguished_names
5Xem thêm ¶
options
bây giờ cũng hỗ trợ ## site.test
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
SSLEngine on
SSLCertificateFile "crt/site.test/server.crt"
SSLCertificateKeyFile "crt/site.test/server.key"
9.
private_key
7
Ví dụ ¶
Ví dụ #1 Tạo chứng chỉ tự ký
private_key
8
private_key
9
options
0
options
1
distinguished_names
5Ví dụ #2 Tạo chứng chỉ ECC tự ký [kể từ Php 7.1.0] ¶
Xem thêm
options
3
options
4
options
5
options
6
options
7
distinguished_names
5OpenSSL_CSR_Sign [] - Ký CSR bằng chứng chỉ khác [hoặc chính nó] và tạo chứng chỉ ¶
Xem thêm
options
9
OpenSSL_CSR_Sign [] - Ký CSR bằng chứng chỉ khác [hoặc chính nó] và tạo chứng chỉ ¶
Xem thêm
openssl.conf
0
openssl.conf
1
distinguished_names
5OpenSSL_CSR_Sign [] - Ký CSR bằng chứng chỉ khác [hoặc chính nó] và tạo chứng chỉ ¶
Ẩn danh ¶
openssl.conf
3
openssl.conf
4
distinguished_names
5