在Visual Studio中启用SSL-不提示安装证书 [英] Enable SSL in Visual Studio - not prompted to install certificate

查看:35
本文介绍了在Visual Studio中启用SSL-不提示安装证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照这篇文章中的说明进行操作:

请问我在做什么错?在此处启动Visual Studio中的应用程序时,请参阅我从IE和Firefox收到的警告:在以下位置启用SSLVisual Studio

解决方案

将IIS Express配置为使用SSL的过程包括许多步骤,这些步骤在初次使用时有些棘手.必须要做的最重要的部分如下:

  • 创建/获取/生成SSL证书.例如,可以使用 MakeCert.exe 生成自签名证书.在%ProgramFiles(x86)%\ Windows Kits \ 10 \ bin \ x64 %ProgramFiles(x86)%\ Windows Kits \ 8.1 \ bin \ x64 中查找 MakeCert.exe 实用程序.证书还必须导入受信任的根证书颁发机构"或第三方根证书颁发机构"中,以使其在本地计算机上(或对于本地用户)受信任.
  • IIS Express使用操作系统的基础HTTP.SYS来处理所有HTTP/HTTPS请求.因此,必须配置它,例如,通过使用 netsh http add sslcert ... netsh http add urlacl ... 或使用%带有 setupFriendlyHostnameUrl 参数的ProgramFiles%\ IIS Express \ IisExpressAdminCmd.exe"实用程序.
  • 将Visual Studio项目配置为使用HTTPS进行调试,并为IIS Express创建与HTTPS的绑定.人们通常可以在没有Visual Studio的情况下运行IIS Express.然后应在%USERPROFILE%\ Documents \ IISExpress \ config \ applicationhost.co‌nfig 中包含网站的新< binding> 问题.如果仅在Visual Studio内部使用IIS Express,则Visual Studio将在 $(solutionDir)\.vs \ config \ applicationhost.config 文件中插入相应的绑定.

我建议您阅读并遵循Hanselman发表的旧文章在2011年.今天该信息仍然有罪.

I am trying to follow the instructions in this post: http://www.codeproject.com/Tips/766918/Visual-Studio-Use-HTTPS-SSL-On-Web-Application-Pro. I am not prompted with the message "Would you like to trust the IIS SSL certificate?"

No certificate appears in the certificate store as shown below:

What am I doing wrong please? Please see the warnings I get from IE and Firefox when launching the app in Visual Studio here: Enable SSL in Visual Studio

解决方案

Configuring of IIS Express to use SSL consist from many steps, which are a little tricky at the first usage. The most important parts, which one have to do, are the following:

  • create/get/generate SSL certificate. One can use MakeCert.exe for example to generate self-signed certificate. Look at %ProgramFiles(x86)%\Windows Kits\10\bin\x64 or %ProgramFiles(x86)%\Windows Kits\8.1\bin\x64 for the MakeCert.exe utility. The certificate have to be imported in "Trusted Root Certification Authorities" or "Third-Party Root Certification Authorities" additionally to make it trusted on the local computer (or for the local user).
  • IIS Express uses underlying HTTP.SYS of the operation system to process all HTTP/HTTPS requests. Thus one have to configure it, for example, by usage netsh http add sslcert ... and netsh http add urlacl ... or by using of "%ProgramFiles%\IIS Express\IisExpressAdminCmd.exe" utility with setupFriendlyHostnameUrl parameter.
  • configure Visual Studio project to use HTTPS for debugging and to create binding with HTTPS for IIS Express. One can run IIS Express in general without Visual Studio. Then including of new <binding> issue for the web site should be included in %USERPROFILE%\Documents\IISExpress\config\applicationhost.co‌​‌​‌​nfig. If one uses IIS Express only inside of Visual Studio, then the corresponding binding will be inserted by Visual Studio in the $(solutionDir)\.vs\config\applicationhost.config file.

I'd recommend you to read and to follow the old article posted by Hanselman in 2011. The information is still guilty today.

这篇关于在Visual Studio中启用SSL-不提示安装证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆