Hướng dẫn cài ca local cho website iis

Ngày đăng: 2015-07-10 15:26:52 | Cập nhật: 2020-03-19 15:12:43

Để cài đặt chứng thư số SSL cho IIS 8/8.5 trên Windows Server 2012, bạn thực hiện như sau :

Bước 1: Copy 2 files cert được gửi cho bạn và tải lên server [gồm 2 files certificate.cer và intermediate.cer]

Bước 2: Cài đặt Intermediate CA - Mở một MMC. Nhấn Start > Run... và gõ vào mmc. Nhấn OK. - Từ menu của màn hình Microsoft Management Console [MMC], chọn mục File > Add/Remove Snap-in. Nhấn Add

- Từ danh sách snap-ins, chọn Certificates. Nhấn Add. Chọn Computer account. Nhấn Next. Chọn Local computer. Nhấn Finish. Nhấn Close. Nhấn OK

- Trong khung bên trái, nhấn chọn mục Intermediate Certification Authorities. Nhấp chuột phải vào Certificates, chọn All Tasks > Import. Trong màn hình Certificate Import, nhấn Next. Tới đây chọn đường dẫn đến file intermediate.cer trên Desktop và nhấn Next. Chọn mục "Place all certificate in the following store: Intermediate Certification Authorities". Nhấn Next. Nhấn Finish.

Bước 3: Cài đặt cchứng thư số vào IIS - Nhấn Start > Administrative Tools > Internet Information Services [IIS] Manager - Từ menu bên trái, nhấp chọn vào tên máy chủ - Từ menu ở giữa, trong mục Security, nhấp đúp vào mục Server Certificates

- Từ menu bên phải, chọn Complete Certificate Request

- Chọn đường dẫn đến file certificate.cer. Nhập vào tên gợi nhớ cho chứng thư số trong mục Friendly name. Lưu ý: Nếu bạn mua chứng thư số cho nhiều tên miền [SAN hoặc Wildcard], bạn cần phải thêm ký tự * vào đầu của Friendly Name, ví dụ *Symantec 2015. Khi đó bạn có thể chia sẻ chứng thư số này cho nhiều website được host chung trên máy chủ này. Chọn Personal Store. Sau đó nhấn OK.

Bước 4: Cấu hình SSL cho website

- Nhấn Start > Administrative Tools > Internet Information Services [IIS] Manager - Từ menu bên trái, nhấp chọn vào tên máy chủ - Trong mục Sites, chọn website cần cấu hình SSL - Trong menu bên phải, chọn "Bindings..."

- Trong màn hình Site Bindings, nhấn Add. Lưu ý: Nếu bạn đang gia hạn chứng thư số cho website, thì trong màn hình này, bạn chọn dòng "https" và sau đó nhấn Edit.

- Trong màn hình Add Site Bindings, chọn "https" trong mục Type, chọn Port cần chạy SSL [443], nhập vào tên miền của website trong mục Host Name, cuối cùng chọn chứng thư số vừa cài đặt trong bước trước đó. Sau đó nhấn OK. Lưu ý: Nếu bạn muốn chia sẻ nhiều chứng thư số cho một địa chỉ IP, bạn cần chọn mục "Require Server Name Indication".

Hãy nâng cấp lên Microsoft Edge để tận dụng các tính năng mới nhất, bản cập nhật bảo mật và hỗ trợ kỹ thuật.

Internet Information Services [IIS] Server Certificate Installation Instructions

  • Bài viết
  • 03/30/2023

Trong bài viết này

To run the samples that securely communicate with Internet Information Services [IIS], you must create and install a server certificate.

Step 1. Creating Certificates

To create a certificate for your computer, open a Developer Command Prompt for Visual Studio with administrator privileges and run the Setup.bat that is included in each of the samples that use secure communication with IIS. Ensure that the path includes the folder that contains Makecert.exe before you run this batch file. The following command is used to create the certificate in Setup.bat.

makecert -sr LocalMachine -ss My -n CN=ServiceModelSamples-HTTPS-Server -sky exchange -sk ServiceModelSamples-HTTPS-Key

Step 2. Installing Certificates

The steps required to install the certificates you just created depend on which version of IIS you are using.

To install IIS on IIS 5.1 [Windows XP] and IIS 6.0 [Windows Server 2003]

  1. Open the Internet Information Services Manager MMC Snap-In.
  2. Right-click the default Web site and select Properties.
  3. Select the Directory Security tab.
  4. Click the Server Certificate button. The Web Server Certificate Wizard starts.
  5. Complete the wizard. Select the option to assign a certificate. Select the ServiceModelSamples-HTTPS-Server certificate from the list of certificates that are displayed.
  6. Test access to the service in a browser by using the HTTPS address //localhost/servicemodelsamples/service.svc.

If SSL was previously configured by using Httpcfg.exe

  1. Use Makecert.exe [or run Setup.bat] to create the server certificate.
  2. Run the IIS manager and install the certificate according to the previous steps.
  3. Add the following line of code to the client program.

Important

This code is only required for test certificates such as those created by Makecert.exe. It is not recommended for production code.

PermissiveCertificatePolicy.Enact["CN=ServiceModelSamples-HTTPS-Server"];

To install IIS on IIS 7.0 [Windows Vista and Windows Server 2008]

  1. From the Start menu, click Run, then type inetmgr to open the Internet Information Services [IIS] MMC snap-in.
  2. Right-click the Default Web Site and select Edit Bindings…
  3. Click the Add button of the Site Bindings dialog box.
  4. Select HTTPS from the Type drop-down list.
  5. Select the ServiceModelSamples-HTTPS-Server from the SSL certificate drop-down list and click OK.
  6. Test access to the service in a browser by using the HTTPS address //localhost/servicemodelsamples/service.svc.

Note

Because the test certificate you have just installed is not a trusted certificate, you may encounter additional security warnings when browsing to local web addresses secured with this certificate.

Removing Certificates

Use the Internet Information Services Manager as previously directed, but remove the certificate or binding instead of adding it.

Chủ Đề