How to: Configure a Port with an SSL certificate

We suggest that you read the original article at:

URL: http://msdn.microsoft.com/en-us/library/ms733791.aspx

To configure a port, the tool you use depends on the operating system that is running on your machine.

If you are running Windows Server 2003 or Windows XP, use the HttpCfg.exe tool. With Windows Server 2003 this tool is installed. With Windows XP, you can download the tool at

Windows XP Service Pack 2 Support Tools. For more information, see Httpcfg Overview. The Windows Support Tools documentation explains the syntax for the Httpcfg.exe tool.

If you are running Windows Vista or newer, use the Netsh.exe tool that is already installed.

This topic describes how to accomplish several procedures:

  • Determining a computer's current port configuration.
  • Getting a certificate's thumbprint (necessary for the following two procedures).
  • Binding an SSL certificate to a port configuration.
  • Binding an SSL certificate to a port configuration and supporting client certificates.
  • Deleting an SSL certificate from a port number.

Note that modifying certificates stored on the computer requires administrative privileges.

To determine how ports are configured

  1. In Windows Server 2003 or Windows XP, use the HttpCfg.exe tool to view the current port configuration, using the query and ssl switches, as shown in the following example.

    httpcfg query ssl
  2. In Windows Vista or newer, use the Netsh.exe tool to view the current port configuration, as shown in the following example.

    netsh http show sslcert

To get a certificate's thumbprint

  1. Use the Certificates MMC snap-in to find an X.509 certificate that has an intended purpose of client authentication. For more information, see How to: View Certificates with the MMC Snap-in.

  2. Access the certificate's thumbprint. For more information, see How to: Retrieve the Thumbprint of a Certificate.

  3. Copy the thumbprint of the certificate into a text editor, such as Notepad.

  4. Remove all spaces between the hexadecimal characters. One way to accomplish this is to use the text editor's find-and-replace feature and replace each space with a null character.

To bind an SSL certificate to a port number

  1. In Windows Server 2003 or Windows XP, use the HttpCfg.exe tool in "set" mode on the Secure Sockets Layer (SSL) store to bind the certificate to a port number. The tool uses the thumbprint to identify the certificate, as shown in the following example.

    httpcfg set ssl -i 0.0.0.0:8012 -h 0000000000003ed9cd0c315bbb6dc1c08da5e6
    • The -i switch has the syntax of IP:port and instructs the tool to set the certificate to port 8012 of the computer. Optionally, the four zeroes that precede the number can also be replaced by the actual IP address of the computer.
    • The -h switch specifies the thumbprint of the certificate.
  2. In Windows Vista or newer, use the Netsh.exe tool, as shown in the following example.

    netsh http add sslcert ipport=0.0.0.0:8000 certhash=0000000000003ed9cd0c315bbb6dc1c08da5e6 appid={00112233-4455-6677-8899-AABBCCDDEEFF}
    • The certhash parameter specifies the thumbprint of the certificate.
    • The ipportparameter specifies the IP address and port, and functions just like the -i switch of the Httpcfg.exe tool described.
    • The appid parameter is a GUID that can be used to identify the owning application.

To bind an SSL certificate to a port number and support client certificates

  1. In Windows Server 2003 or Windows XP, to support clients that authenticate with X.509 certificates at the transport layer, follow the preceding procedure but pass an additional command-line parameter to HttpCfg.exe, as shown in the following example.

    httpcfg set ssl -i 0.0.0.0:8012 -h 0000000000003ed9cd0c315bbb6dc1c08da5e6 -f 2

    The -f switch has the syntax of n where n is a number between 1 and 7. A value of 2, as shown in the preceding example, enables client certificates at the transport layer. A value of 3 enables client certificates and maps those certificates to a Windows account. See HttpCfg.exe Help for the behaviour of other values.

  2. In Windows Vista or newer, to support clients that authenticate with X.509 certificates at the transport layer, follow the preceding procedure, but with an additional parameter, as shown in the following example.

    netsh http add sslcert ipport=0.0.0.0:8000 certhash=0000000000003ed9cd0c315bbb6dc1c08da5e6 appid={00112233-4455-6677-8899-AABBCCDDEEFF} clientcertnegotiation=enable

To delete an SSL certificate from a port number

  1. Use the HttpCfg.exe or Netsh.exe tool to see the ports and thumbprints of all bindings on the computer. To print the information to disk, use the redirection character ">", as shown in the following example.

    httpcfg query ssl>myMachinePorts.txt
  2. In Windows Server 2003 or Windows XP, use the HttpCfg.exe tool with the delete and ssl keywords. Use the -i switch to specify the IP:port number, and the -h switch to specify the thumbprint.

    httpcfg delete ssl -i 0.0.0.0:8005 -h 0000000000003ed9cd0c315bbb6dc1c08da5e6
  3. In Windows Vista or newer, use the Netsh.exe tool, as shown in the following example.

    Netsh http delete sslcert ipport=0.0.0.0:8005

FAQs

Does the software support secure SSL based POP3 connections for downloading e-mail?

Absolutely! You can download emails securely using SSL-based POP3 connections.

During the email user configuration process, simply check the "SSL" checkbox located in the "E-mail to SMS" tab. This ensures your email retrieval is encrypted for added security.

Does the software support Secure SSL based SMTP connections?

Absolutely! To activate this feature, navigate to the "Advanced" tab within the Email user configuration form.

More information