6

I am trying to run the following command in PowerShell:

Command-

netsh http delete sslcert hostnameport="services.localtest.me:443"

Result-

'hostnameport' is not a valid argument for this command.
The syntax supplied for this command is not valid. Check help for the correct syntax.

I am getting an error stating that hostnameport is not a valid argument, however it is documented on this site as a Community Addition. Also, if you look in some of the GitHub repos from Microsoft, you'll see it being used, such as in this PowerShell script.

Is this argument only valid on specific versions of Windows? Is it only available on Windows Server? Can I enable something in Windows Features to make this argument work?

Ryan Mendoza
  • 920
  • 1
  • 13
  • 27
  • What happens when you run `netsh http delete sslcert`. It should print the help with examples. If you think it is a version issue, what version of Windows are you using? – Mike Zboray Dec 01 '15 at 20:58
  • Read the doc. `netsh http add sslcert` supports the `hostnameport` argument. `netsh http delete sslcert` does not. Compare `netsh http add sslcert ?` and `netsh http delete sslcert ?`. – Bacon Bits Dec 01 '15 at 21:00
  • Here is the output: Parameters: Tag Value ipport - The IPv4 or IPv6 address and port for which the SSL certificate bindings will be deleted. I am on Windows 7 SP1, but I have Windows Management Framework 5.0 installed. – Ryan Mendoza Dec 01 '15 at 21:01
  • @BaconBits what is "the doc"? I am not seeing anything to back up your comment. – Ryan Mendoza Dec 01 '15 at 21:04
  • 4
    @BaconBits It is supported in some environments, at least on 2012 R2 it is: "Usage: delete sslcert ipport= | hostnameport= | ccs=" – Mike Zboray Dec 01 '15 at 21:04
  • @mikez I see it on 2012 R2 as well, but it's not on my 2008 R2 systems. It must be a recent addition. The doc he links is for 2008, so I assumed that's what he's on. I doubt it's there. – Bacon Bits Dec 01 '15 at 21:12
  • @mikez do you know if this functionality is tied to the operating system, or can it be installed via an SDK or developer kit? – Ryan Mendoza Dec 01 '15 at 21:23
  • in general, each SSL binding require unique IP but from windows server 2012 onward there's an update of SNI support where you can assign multiple SSL binding using domain name on single IP Address and that's when the support of hostnameport argument started in. So, it won't work in older server OS. – hsCode Apr 18 '22 at 08:12

1 Answers1

3

Please use the following command

netsh http delete sslcert hostnameport=localhost:443

Ref :http://www.it-word.net/command/Windows/netsh/en-us/netshhttp.html

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Arider
  • 31
  • 2