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 Visual Studio command prompt 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.

To install IIS on IIS 7.0 (Windows Vista and Windows Server 2008)

From the Start menu, click Run, then type inetmgr to open the Internet Information Services (IIS) MMC snap-in.

Right-click the Default Web Site and select Edit Bindings…

Click the Add button of the Site Bindings dialog box.

Select HTTPS from the Type drop-down list.

Select the ServiceModelSamples-HTTPS-Server from the SSL certificate drop-down list and click OK.

Test access to the service in a browser by using the HTTPS address https://localhost/servicemodelsamples/service.svc.

Note:

Because the test certificate you have just installed is not a trusted certificate, you may encounter additional Internet Explorer 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.