"The parameter is incorrect" error using "netsh http add sslcert"

Viewed 91773

Following the instructions in How to: Configure a Port with an SSL Certificate, I entered this command on the command line (duh):

netsh http add sslcert ipport:10.141.146.227:7001 certhash=5d48e604007b867ae8a69260a4ad318d2c05d8ff appid={EDE3C891-306C-40fe-BAD4-895B236A1CC8}

Output:

The parameter is incorrect.

My certhash thumbprint was taken from the certificate in Certificates (Local Computer)PersonalCertificates folder.

The appid GUID was generated.

What else is wrong that I need to fix to get this to work?

20 Answers

In PowerShell, just type as follows. First get into netsh HTTP mode and then add sslcert. It's worked for me.

netsh

In the netsh session:

http

add sslcert ipport=0.0.0.0:13286 appid='{a5455c78-6489-4e13-b395-47fbdee0e7e6}' certhash=<thumprint without space>

Looking at the syntax for the netsh command, I saw this example:

add sslcert ipport=1.1.1.1:443 certhash=0102030405060708090A0B0C0D0E0F1011121314 appid={00112233-4455-6677-8899-AABBCCDDEEFF}

By the looks of it, your problem is that you're doing

ipport:10.141.146.227:7001
      ^

as opposed to

ipport=10.141.146.227:7001
      ^

I was getting this error as well when I was just getting started with HTTP.sys (IIS). After I ran:

netsh http add iplisten ipaddress=0.0.0.0

then the netsh http add sslcert commands started behaving properly.

In my case the problem is that I am following the Microsoft instructions. I copied the thumbprint from the SSL window. Doing so copies non-printable characters at the beginning of the hash.

Try to paste the thumbprint into Notepad and then press Home and press Delete twice (until the first characters from the thumbprint is deleted) and the readd the character. You can see the character if you copy the thumbprint and paste it into cmd:

Thumbprint with "?"

There were a few things I did that I thought made it work after getting the same "The parameter is incorrect." error.

  1. I restarted the machine and did it again. It worked the first time.

  2. I made sure I was in C:\ and issued the command again after restarting didn't work

    I couldn't explain why, but I think that maybe both times, there was something else wrong. Because the third time this happened to me:

  3. I went through the thumbprint of my CA (not the issued server cert) and copied it again from the MMC and it worked.

After this happened, I deleted it again (netsh http delete sslcert ipport=0.0.0.0:) and repeated the process using the thumbprint of the server certificate. The darned thing worked again.

I don't know. Just try going through the same thing I did. Maybe one of these would work. In the end, I suspect that I entered a bogus space or character in the certhash.

This is actually a syntax problem of cmd vs PowerShell. Changing the command to

netsh http add sslcert ipport=0.0.0.0:8085 certhash=4da5af739d6745de4e38fea9574cdaa79032ea14 appid="{7BBE87B9-D98F-41D7-B726-FC5E1300ED28}"

will work in both terminals.

I was trying to add an IP address and port with the hostnameport parameter, so I got this parameter error.

netsh http add sslcert hostnameport="10.0.0.120:443"

Instead of:

netsh http add sslcert ipport="10.0.0.120:443"

I had a hidden issue that only showed in PowerShell, not on a command prompt.

I had copied a thumbprint from a certificate and removed all spaces in Notepad++, but it still had a hidden character in front.

It looked like this:

.. certhash=dca41243...

It was actually

.. certhash="special char"dca41243...

Related