Require Secure Sockets Layer (IIS 7)
Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista
You must first configure a Server Certificate and create an HTTPS binding to enable any SSL Settings. You must require Secure Sockets Layer (SSL) encryption in one or more of the following circumstances:
When confidential or personal content on your server must be protected by an encrypted channel.
When you want users to be able to confirm the identity of your server before they transmit personal information.
When you want to use client certificates to authenticate clients that access your server.
For information about the levels at which you can perform this procedure, and the modules, handlers, and permissions that are required to perform this procedure, see Secure Sockets Layer Feature Requirements (IIS 7).
Exceptions to Feature Requirements
To require SSL
You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.
To use the UI
Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).
In Features View, double-click SSL Settings.
Make sure that you are at the site, application, or directory level; SSL Settings are not available at the Server level. To configure SSL at the file level, navigate to the file in Content View and then click Switch to Features View in the Actions pane.
On the SSL Settings page, select Require SSL.
In the Actions pane, click Apply.
To require SSL, use the following syntax:
appcmd set config "site | URL" /section:access /sslFlags:Ssl /commit:APPHOST
The variable site | URL is the site, application, virtual directory, or file where you want IIS 7 to require SSL. For example, to require SSL for the Default Web Site, type the following at the command prompt, and then press ENTER:
appcmd set config "Default Web Site" /section:access /sslFlags:Ssl /commit:APPHOST
To require SSL for the file iisstart.htm on the Default Web Site, type the following at the command prompt, and then press ENTER:
appcmd set config "http://localhost/iisstart.htm" /section:access /sslFlags:Ssl /commit:APPHOST
When you use Appcmd.exe to configure the access element at the site, application, virtual directory, or file level in IIS 7, you must specify /commit:APPHOST in the command so that configuration changes are made to ApplicationHost.config with an appropriate location tag.
For more information about Appcmd.exe, see Appcmd.exe (IIS 7).
The procedure in this topic affects the following configuration elements:
<access> under <security> under <system.webServer>
For more information about IIS 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.
Use the following WMI classes, methods, or properties to perform this procedure:
- AccessSection.SSLFlags property
For more information about WMI and IIS, see Windows Management Instrumentation (WMI) in IIS 7. For more information about the classes, methods, or properties associated with this procedure, see the IIS WMI Provider Reference on the MSDN site.