Redirect HTTP Requests to HTTPS

It is possible to redirect http requests to https and to drop the port number. For example, Your users may appreciate the simplicity of reaching Password Server by typing this in the address bar:

By default, your web address for Pleasant Password Server is:

  • https://YourServerName:10001
    • YourServerName is the machine name running Password Server, or just localhost on the same machine
    • 10001 is the port it is running on

Alternate Methods

  1. Using Technical Config changes, mentioned in the steps below...
  2. Setup Hosting with IIS
  3. Set up an IIS redirect, to direct incoming requests from:
    • http://<server-name> to https://<server-name>:<port-number>
  4. Changing the port to 443, will allow the browser/client URL to display without the port number.
    • Note: that this change will only redirect all HTTPS traffic to Password Server, which in some cases is not advisable.

Technical Steps

Method 1: To make these changes, follow the instructions below (being sure to replace YourServerName, and port 10001):

  1. Stop the Password Server service.

  2. Run Command Prompt (as Administrator):

    netsh http add urlacl url=http://YourServerName:80/ user=everyone

  3. Make a backup of this file, and open to make a change:

    C:\ProgramData\Pleasant Solutions\Password Server\IISExpress\PleasantPasswordManagerHost.config

  4. Add the following line to the binding section of the PleasantPasswordServer site:

    <binding protocol="http" bindingInformation="*:80:YourServerName" />

  5. Make a backup of this file, and open to make a change:

    C:\Program Files (x86)\Pleasant Solutions\Pleasant Password Server\www\Web.config

  6. Replace the existing rule for "HTTP to HTTPS redirect" with this:

    <rule name="HTTP to HTTPS redirect" enabled="true" stopProcessing="true">
      <match url="(.*)" />
        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
      <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}:10001/{R:1}" appendQueryString="true"/>

  7. (if necessary) Add firewall rules for port 80 & 10001 (or the port you plan to use instead of 10001)
  8. Start the Password Server service.
  9. (see the Troubleshooting Tips / Reverting below)

Please Note: All changes to Config files will be over-written on Version Upgrades / Installation, and will need to be re-applied (along with any other config file changes). However, Step 2 changes will not need to be repeated.

Troubleshooting Tips / Reverting

  • If you want to view current http sites or to remove them, it is possible to use these commands:
    • netsh http show
    • netsh http delete urlacl url=http://YourServerName:80/ user=everyone
  • If the service does not start, check if IISExpress is running, it can be stopped from task manager
  • Double-check that the changes have been applied correctly, right syntax, and the server & port replacements have been made.
  • When making these changes, be sure to stop and re-start the service for the changes to take effect.
  • It is possible to revert to the config file backups you have made, if needed
  • It is possible to run the install to repair Pleasant Password Server, if needed
Tag page
You must login to post a comment.