by Saad Ladki
How can I configure an SSL Certificate on IIS Web Server? SSL Certificates are small data files that digitally bind a cryptographic key to an organization’s details. When installed on a web server, it activates the padlock and the https protocol and allows secure connections from a web server to a browser. Start IIS Manager. One quick way to do this is by opening the Run command, then typing inetmgr and clicking the OK button.
The steps for configuring Secure Sockets Layer (SSL) for a site are the same in IIS 7 and above and IIS 6.0, and include the following:
- Get an appropriate certificate.
- Create an HTTPS binding on a site.
- Test by making a request to the site.
- Optionally configure SSL options, that is, by making SSL a requirement.
This document provides some basic information on SSL, then shows how to enable SSL in the following ways:
- Using IIS Manager.
- Using the AppCmd.exe command line tool.
- Programmatically through Microsoft.Web.Administration.
- Using WMI scripts.
This article contains the following sections:
Whether you are running your web site on your own server, or in the cloud, using SSL to secure your site is probably extremely important to you, as many websites are turning to it to protect user's privacy. If you need to configure SSL on your server, it's important to realize that the implementation of SSL changed from IIS 6.0 to IIS 7 and above. In IIS 6.0 on Windows Server 2003, all SSL configuration was stored in the IIS metabase, and encryption/decryption occurred in User mode (requiring a lot of kernel/user mode transitions). In IIS 7 and above, HTTP.sys handles SSL encryption/decryption in kernel mode, resulting in up to 20% better performance for secure connections in IIS 7 and above than that experienced in IIS 6.0.
Using SSL in kernel mode requires storing SSL binding information in two places. First, the binding is stored in %windir%System32inetsrvconfigapplicationHost.config for your site. When the site starts, IIS sends the binding to HTTP.sys, and HTTP.sys starts listening for requests on the specified IP:Port (this works for all bindings). Second, the SSL configuration associated with the binding is stored in the HTTP.sys configuration. Use the netsh command at a command prompt to view SSL binding configuration stored in HTTP.sys as in the following example:
When a client connects and initiates an SSL negotiation, HTTP.sys looks in its SSL configuration for the IP:Port pair to which the client connected. The HTTP.sys SSL configuration must include a certificate hash and the name of the certificate store before the SSL negotiation will succeed.
Troubleshooting Tip: If you're having trouble with an SSL binding, verify that the binding is configured in ApplicationHost.config, and that the HTTP.sys store contains a valid certificate hash and store name for the binding.
Choosing a Certificate
When choosing a certificate, consider the following: Do you want end users to be able to verify your server's identity with your certificate? If yes, then either create a certificate request and send that request to a known certificate authority (CA) such as VeriSign or GeoTrust, or obtain a certificate from an online CA in your intranet domain. There are three things that a browser usually verifies in a server certificate:
- That the current date and time is within the 'Valid from' and 'Valid to' date range on the certificate.
- That the certificate's 'Common Name' (CN) matches the host header in the request. For example, if the client is making a request to
https://www.contoso.com/, then the CN must be
- That the issuer of the certificate is a known and trusted CA.
If one or more of these checks fails, the browser prompts the user with warnings. If you have an Internet site or an intranet site where your end users are not people you know personally, then you should always ensure that these three parameters are valid.
Self-signed certificates are certificates created on your computer. They're useful in environments where it's not important for an end user to trust your server, such as a test environment.
You cannot request or create a certificate by using AppCmd.exe. You also cannot use AppCmd.exe to create an SSL binding.
Configure SSL Settings
You can use AppCmd.exe to configure a site to accept only server HTTPS connections by modifying the sslFlags attribute in the Access section. For example, you can configure this setting for the 'Default Web Site' in the ApplicationHost.config file (for example, commitPath:APPHOST) by using the following command:
If successful, the following message is displayed:
To require 128-bit SSL, change the sslFlags value to Ssl128.
The following example demonstrates how to view the <access/> section settings for the Default Web Site. The sslFlags attribute has been set successfully.
Executing the command results in the following entry in the ApplicationHost.config file:
You cannot request or create a certificate by using the WebAdministration WMI namespace.
Create an SSL Binding
The following script demonstrates how to create a new SSL binding and how to add the appropriate configuration for both HTTP.sys and IIS:
The certificate hash and store must reference a real, functional certificate on your server. If the certificate hash and/or store name are bogus, an error is returned.
Configure SSL Settings
The following script demonstrates how to set SSL settings by using the IIS WMI provider. You can find this value in the IIS_Schema.xml file.
Obtain a Certificate
Select the server node in the treeview and double-click the Server Certificates feature in the listview:
Click Create Self-Signed Certificate... in the Actions pane.
Enter a friendly name for the new certificate and click OK.
Now you have a self-signed certificate. The certificate is marked for 'Server Authentication' use; that is, it uses as a server-side certificate for HTTP SSL encryption and for authenticating the identity of the server.
Create an SSL Binding
Select a site in the tree view and click Bindings... in the Actions pane. This brings up the bindings editor that lets you create, edit, and delete bindings for your Web site. Click Add... to add your new SSL binding to the site.
The default settings for a new binding are set to HTTP on port 80. Select https in the Type drop-down list. Select the self-signed certificate you created in the previous section from the SSL Certificate drop-down list and then click OK.
Now you have a new SSL binding on your site and all that remains is to verify that it works.
Verify the SSL Binding
In the Actions pane, under Browse Web Site, click the link associated with the binding you just created.
Internet Explorer (IE) 7 and above will display an error page because the self-signed certificate was issued by your computer, not by a trusted Certificate Authority (CA). IE 7 and above will trust the certificate if you add it to the list of Trusted Root Certification Authorities in the certificates store it on the local computer, or in Group Policy for the domain.Click Continue to this website (not recommended).
Configure SSL Settings
Configure SSL settings if you want your site to require SSL, or to interact in a specific way with client certificates. Click the site node in the tree view to go back to the site's home page. Double-click the SSL Settings feature in the middle pane.
In this walkthrough, we successfully used the command-line tool AppCmd.exe, the scripting provider WMI, and IIS Manager to set up SSL on IIS.
Iis Ssl O
OpenSSL is a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. For more information about the team and community around the project, or to start making your own contributions, start with the community page. To get the latest news, download the source, and so on, please see the sidebar or the buttons at the top of every page.
OpenSSL is licensed under an Apache-style license, which basically means that you are free to get and use it for commercial and non-commercial purposes subject to some simple license conditions.
For a list of vulnerabilities, and the releases in which they were found and fixes, see our Vulnerabilities page.
|06-May-2021||Alpha 16 of OpenSSL 3.0 is now available: please download and test it|
|22-Apr-2021||Alpha 15 of OpenSSL 3.0 is now available: please download and test it|
|08-Apr-2021||Alpha 14 of OpenSSL 3.0 is now available: please download and test it|
|25-Mar-2021||OpenSSL 1.1.1k is now available, including bug and security fixes|
|11-Mar-2021||Alpha 13 of OpenSSL 3.0 is now available: please download and test it|
Openssl : The Term Openssl Is Not Recognized
Please remember that export/import and/or use of strongcryptography software, providing cryptography hooks, or even justcommunicating technical details about cryptography software isillegal in some parts of the world. So when you import thispackage to your country, re-distribute it from there or evenjust email technical suggestions or even source patches to theauthors or other people you are strongly advised to pay closeattention to any laws or regulations which apply toyou. The authors of OpenSSL are not liable for any violationsyou make here. So be careful, it is your responsibility.