Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSL Certificate add failed, Error: 183 Cannot create a file when that file already exists - How to bound certificate to ipport?

I'm trying to execute this command in CMD:

netsh http add sslcert ipport=0.0.0.0:443 certhash=‎89857a42309423c239f42392384a appid={214124cd-d05b-4309-9af9-13123454a52b}

and got error message:

SSL Certificate add failed, Error: 183 Cannot create a file when that file already exists.

How to add certificate to ipport if the certificate has already been added?

like image 611
essential Avatar asked Sep 07 '19 11:09

essential


1 Answers

It means that the port has already bounded a certificate. If we want to bound new certificate we need to delete the old one and bound new one.

  1. Check if port has bounded a cert:

    netsh http show sslcert > c:\result.txt

  2. Open the result.txt and search for the port (in my case 443)

  3. Delete the old certificate: netsh http delete sslcert ipport=0.0.0.0:443

  4. Bound new certificate

    netsh http add sslcert ipport=0.0.0.0:443 certhash=‎89857a42309423c239f42392384a appid={214124cd-d05b-4309-9af9-13123454a52b}

like image 159
essential Avatar answered Nov 06 '22 10:11

essential