How to: Configure an IIS-hosted WCF service with SSL
Article
This topic describes how to set up an IIS-hosted WCF service to use HTTP transport security. HTTP transport security requires an SSL certificate to be registered with IIS. If you do not have an SSL certificate you can use IIS to generate a test certificate. Next you must add an SSL binding to the web site and configure the web site’s authentication properties. Finally you need to configure the WCF service to use HTTPS.
Creating a Self-Signed Certificate
Open Internet Information Services Manager (inetmgr.exe), and select your computer name in the left-hand tree view. On the right-hand side of the screen select Server Certificates
In the Server Certificates window click the Create Self-Signed Certificate…. Link.
Enter a friendly name for the self-signed certificate and click OK.
The newly created self-signed certificate details are now shown in the Server Certificates window.
The generated certificate is installed in the Trusted Root Certification Authorities store.
Add SSL Binding
Still in Internet Information Services Manager, expand the Sites folder and then the Default Web Site folder in the tree view on the left-hand side of the screen.
Click the Bindings…. Link in the Actions section in the upper right hand portion of the window.
In the Site Bindings window click the Add button.
In the Add Site Binding dialog, select https for the type and the friendly name of the self-signed certificate you just created.
Configure Virtual Directory for SSL
Still in Internet Information Services Manager, select the virtual directory that contains your WCF secure service.
In the center pane of the window, select SSL Settings in the IIS section.
In the SSL Settings pane, select the Require SSL checkbox and click the Apply link in the Actions section on the right hand side of the screen.
Configure WCF Service for HTTP Transport Security
In the WCF service’s web.config configure the HTTP binding to use transport security as shown in the following XML.
As an Information Security Administrator, you plan and implement information security of sensitive data by using Microsoft Purview and related services. You’re responsible for mitigating risks by protecting data inside collaboration environments that are managed by Microsoft 365 from internal and external threats and protecting data used by AI services. You also implement information protection, data loss prevention, retention, insider risk management, and manage information security alerts and activities.
Learn how to configure HTTP/HTTPS to allow WCF services and clients to communicate. Configure a URL registration and a Firewall exception by using Netsh.exe.
Learn about the major transport security mechanisms in the WCF system-provided bindings. These security mechanisms depend on the binding and transport used.