Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 741
Derrick Avatar asked Apr 22 '09 21:04

Derrick


3 Answers

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

>netsh  netsh>http  netsh http>add sslcert ipport=0.0.0.0:13286 appid='{a5455c78-6489-4e13-b395-47fbdee0e7e6}' certhash=<thumprint without space> 
like image 174
Abdul Hakim Avatar answered Sep 19 '22 06:09

Abdul Hakim


Another possible cause for this problem is hidden characters being copied from the Certificate Manager page. If you copy the thumbprint from the details window in Certificates, check for a hidden character at the start (use your arrow keys!). This was the cause for me of the "The Parameter is Incorrect" error message.

like image 25
Richard Avatar answered Sep 19 '22 06:09

Richard


The PowerShell command line and PowerShell scripts in .ps1 files will think curly brackets {...} are PowerShell directives. So quote them. Otherwise, as you have seen, PowerShell will be confused.

So rather than this (which you found fails):

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

Do this (note the single quotes):

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

Here is some information about PowerShell syntax with curley braces:

PowerShell and the hidden art of curly braces and other braces

like image 33
codingoutloud Avatar answered Sep 19 '22 06:09

codingoutloud