IIS loses HTTPS Endpoitn certificate after computer restart

时光怂恿深爱的人放手 提交于 2020-01-02 19:56:12

问题


I know I am not the one who is losing a certificate association after computer restart. In particular:

  • Open "Site Bindind" dialog in IIS
  • Find my HTTPS binding
  • Press "Edit..."
  • From the "SSL certificate" I am selecting my certifivate
  • Press Apply

Everything works just perfect, but until the computer restarts. After the restart when I open the Binding properties I see (Not selected)

what I have discovered that after

netsh http show sslcert 

I cannot see my port I am using for HTTPS binding

when I am netsh http add sslcert ipport=0.0.0.0:port certhash= appid={ID}

everything works further

As sa fast but dirty solution I have created a bat file with the following content:

netsh http del sslcert ipport=0.0.0.0:port
netsh http add sslcert ipport=0.0.0.0:port certhash=<Hash> appid={ID}

and scheduled launch of the bat file in Windows Scheduler (At start up after 1 minutes) worked for some time, but now has stopped.

What is wrong at how to fix it?


回答1:


I just had a similar problem, where my SSL bindings for my self-hosted OWIN app were lost whenever I restarted the machine.

I came across this post: Adding SSL Certificate via "netsh.exe" does not last after a machine restart, which mentions:

I think by moving the self signed cert from Personal to Trusted Root CA directory causes a problem that SSL stops working after developers reboot their machines. (Don't know how it happens, but it does happen consistently.) I finally get around this issue by export and re-import the self-signed cert into the trusted root directory (instead of simply drag it over). Now my self-signed cert is considered and I don't need to REINSTALL/REPAIR IIS Express every time I reboot the machine.

My scenario was a bit different, but when I imported my localhost SSL cert, I was also using drag-n-drop to copy it from the Personal Certificates for "Current User" to the Personal Certificates for "Local Computer." So I deleted my cert and re-imported without using drag-n-drop, and that seems to have handled it - I can now reboot my machine without losing my SSL port bindings!

Hopefully this will work for you as well (if you are still having the issue).



来源:https://stackoverflow.com/questions/27564823/iis-loses-https-endpoitn-certificate-after-computer-restart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!