Certificate
A certificate, signed by a certificate authority needs to be created and installed on the web server. How this is done differs if the server is accessible from the public internet or not.
Public Facing Web Server
If the web server is public facing then a free certificate can be obtained using Let's Encrypt. follow the instructions in SSL/TLS using Let's Encrypt
Alternatively you can use any commercial certificate authority. Ex: DigiCert, Entrust, Thawte, etc.
Internal Web Server
If the server is internal then an internal Certificate Authority will be needed.
- Identify the Certificate Authority (CA) - If you need to setup Microsoft Certificate Services the following links may help:
- If you don't have Active Directory - http://www.isaserver.org/img/upl/vpnkitbeta2/installstandaloneca.htm
- If you have Active Directory - http://www.isaserver.org/img/upl/vpnkitbeta2/installenterpriseca.htm
- Install the Certificate - Request and install a certificate for the website under which the application will run. See: How to Get a Certificate from an internal CA
- The certificate must be created for a website (ex: Default Web Site) not the virtual directory for the web application.
- A Bit length of 2048 is recommended.
- The website (ex: Default Web Site) does not have to be set to require SSL. That can be set on the virtual directory for the web application.
- See this Microsoft KB article for more information: http://support.microsoft.com/kb/299875
IIS Configuration
Binding
Skip this if Certify SSL Manager was used as it will already be done.
Add an https site binding
- Select the Website that contains the web application (ex: Sites/Default Web Site)
- In the Actions pane, click Bindings...
- In the Site Bindings dialog click Add...
- Add https Binding
- Type: https:
- IP Address: All Unassigned
- Port: 443
- SSL certificate: Select the certification you installed
- Click OK
- Click Close
Service Endpoints
Make it so that web services can or must use HTTPS.
Edit service endpoints in web.config files for Adams Admin and Adams Web
- Open web.config
- Find <services>
- For each endpoint within each <service> do one of:
- For HTTPS access only: Edit “Http” in binding value to “Https”.
Ex: “basicHttpBinding” ➔ “basicHttpsBinding”; “mexHttpBinding” ➔ “mexHttpsBinding” - For both HTTP and HTTPS access: Add a copy all endpoints with “Http” in binding value and edit value to have Https.
Ex: Copy endpoint line and edit “basicHttpBinding” ➔ “basicHttpsBinding” – Use this if both HTTP and HTTPS will be used.
URL Rewrite
Redirect HTTP to HTTPS.
- Install the URL Rewrite Module for IIS: http://www.iis.net/downloads/microsoft/url-rewrite
- Require SSL should not be checked for either Default Web Site or for the application (ex: AdamsAdmin, AdamsWeb, AdamsBridge, etc) under that. You can check the SSL Settings for each to see that it isn’t.
- Create the URL rewrite rules for each web application (i.e. Adams Web, Adams Admin, Adams Bridge)
- In IIS Manager, select the application (ex: AdamsWeb, AdamsAdmin, AdamsBridge) under Default Web Site
- In the application’s IIS section, open the URL Rewrite module
NOTE: If the URL Rewrite module does not appear as an option after installing it, try closing and reopening IIS Manager. - Click Add Rule(s)…
- Select Inbound rules > Blank rule
- Select OK
- Fill in the following information
- Name - HTTP to HTTPS Redirect
- Match URL
- Requested URL - Matches the Pattern
- Using - Regular Expressions
- Pattern - (.*)
- Ignore case - checked
- Conditions
- Logical grouping: Match All
- Click Add…
- Condition input - {HTTPS}
- Check if input string - Matches the Pattern
- Pattern - ^OFF$
- Ignore case - checked
- Click OK
- Click Add…
- Condition input - {PATH_INFO}
- Check if input string - Matches the Pattern
- Pattern - <APPNAME>.* Replace <APPNAME> in this pattern with the web applications name. Ex:
AdamsWeb.*
AdamsBridge.*
AdamsAdmin.* - Ignore case: checked
- Click OK
- Action
- Action type: Redirect
- Redirect URL: https://{HTTP_HOST}/<APPNAME>/ Replace <APPNAME> with the web application name. Ex:
https://{HTTP_HOST}/AdamsWeb/
https://{HTTP_HOST}/AdamsBridge/
https://{HTTP_HOST}/AdamsAdmin/ - Append query string: checked
- Redirect type: Permanent (301)
- Click Apply (in the upper hand corner)
- Click Back to Rules
- Restart the web application pool