development

누락 된 IIS Express SSL 인증서를 어떻게 복원합니까?

big-blog 2020. 7. 11. 08:54
반응형

누락 된 IIS Express SSL 인증서를 어떻게 복원합니까?


IIS Express에서 HTTPS를 설정 한 후 this and this 같은 기사에 따르면 HTTPS를 사용하여 실제로 IIS Express 사이트를로드 할 수 없습니다. Chrome 에서는 다음과 같은 기능 만 제공됩니다.

이 웹 페이지를 사용할 수 없습니다 (오류 코드 "ERR_CONNECTION_RESET")

... IE 에서는 다음과 같은 결과 만 얻습니다.

Internet Explorer가 웹 페이지를 표시 할 수 없습니다

... 그 기사의 지시를 따를 때.

이것은 IIS Express가 자동으로 설치하는 "IIS Express Development Certificate"가 제거되었다는 사실과 관련이있는 것으로 보입니다. 이 인증서를 다시 설치하려면 어떻게합니까?


프로그램 추가 / 제거로 이동하고 IIS Express에서 "복구"옵션을 선택한 후 인증서가 다시 설치되었으며 이제 HTTPS를 사용하여 IIS Express 사이트를 시작할 수 있습니다.

IIS Express 복구

인증서가 돌아 왔습니다 :

IIS Express 개발 인증서

이제 HTTPS를 사용하여 IIS Express 사이트를 시작할 수 있습니다.

성공!


Visual Studio 2015, IIS Express 10, Windows 10의 경우 이러한 옵션이 작동하지 않았습니다. IIS Express 10에는 복구 옵션이 없었습니다.

IisExpressAdminCmd.exe에서 사용할 수 있는 명령을 사용하여 문제를 해결 했습니다 C:\Program Files (x86)\IIS Express.

관리자 권한 명령 프롬프트에서 다음을 실행하십시오.

cd C:\Program Files (x86)\IIS Express
IisExpressAdminCmd.exe setupsslUrl -url:urlToYourSite -UseSelfSigned

urlToYourSite를 귀하의 URL로 교체하십시오.

예 :

cd C:\Program Files (x86)\IIS Express
IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:44387/ -UseSelfSigned

그 후 IIS Express를 닫고 Visual Studio에서 사이트를 다시 시작하면 자체 서명 인증서를 자동으로 신뢰하라는 메시지가 표시됩니다.

희망이 도움이됩니다.


때때로이 오류는 localhost에 설치된 다른 인증서로 인해 발생 합니다. 이 경우 IIS Express 인증서를 복원 할 필요가 없습니다. 대신 다음을 수행하여 IIS Express에 기존 인증서를 사용하도록 지시 할 수 있습니다.

  1. 여기에 설명 된대로 인증서 MMC 스냅인을 엽니 다.
  2. 개인 ... 인증서에서 로컬 호스트 인증서를 찾아 지문을 얻으십시오.
    1. 로컬 호스트 인증서의 속성 대화 상자를 불러 와서 지문 속성을 찾습니다
    2. 지문 값을 메모장 (또는 기타)에 붙여넣고 처음에 공백과 특수 문자를 제거하십시오.
  3. IIS Express 프로젝트의 포트 값을 찾으십시오.
    1. Go to the project properties in Visual Studio and finding the "SSL URL" value, e.g. "https://localhost:44300/MyApp".
    2. In this example 44300 is the port number. If yours is different, change that value in the later commands.
  4. Use the following commands in an administrative command prompt (not Powershell):

netsh http delete sslcert ipport=0.0.0.0:44300

netsh http add sslcert ipport=0.0.0.0:44300 certhash=your_cert_hash_with_no_spaces appid= {123a1111-2222-3333-4444-bbbbcccdddee}

The Guid in the above command can be replaced with one that you generate. It does not correspond to any existing IIS Express value.

For further reference see Handling URL Binding Failures in IIS Express.


Also note that for IIS Express to work with SSL, the port used needs to be in the 44300 through 44399 range (http://www.iis.net/learn/extensions/using-iis-express/running-iis-express-without-administrative-privileges).

So, if you're using IIS Express in Visual Studio, make sure the port selected is in the required range: vs setting for iis express


With new Chrome 58, nothing from the answers below will help. I've just spent 1 hour uninstalling / reinstalling certificates and trying to find out where the problem is.

Apparently Chrome 58 will refuse certificate because "missing_subjectAltName"

The solution is either "badidea" passphrase or if you need to open popups for login you have to use :

chrome://flags/#allow-insecure-localhost

The source is and the upvote belongs to: https://stackoverflow.com/a/38926117/2089232 :)


I wanted to add this, because it is ridiculous but maybe it will help someone. Keep in mind that I had never opened my project properties before so I have no idea how this happened (I did not change this myself or have the opportunity to), but in Project > Properties > Web my SSL url was listed as my usual URL but as http instead of https (had previously been https because it was working before). I went through all the steps listed on this page, uninstalled VS, then IIS, and finally noticed the error which should have been https://mySSLURL (but was missing the s in https). Once I changed http to https everything worked again.


You can reinstall IIS Express 10.0 (or whatever version you need) to fix the missing certificate. Download from Microsoft here

참고 URL : https://stackoverflow.com/questions/20036984/how-do-i-restore-a-missing-iis-express-ssl-certificate

반응형