IIS防爆preSS - 获取SSL上班 [英] IIS Express -- Getting SSL to Work

查看:160
本文介绍了IIS防爆preSS - 获取SSL上班的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法获得IIS防爆preSS接受,我正在开发一个VS2010 MVC3项目安全连接。我能得到它接受端口80上不安全的连接,而不是固定在443端口。

我已经采取下列步骤,根据谷歌搜索:

1)位于SHA1指纹为我的IIS防爆preSS服务器自签名证书通过执行一个命令行VS2010如下:

  certmgr.exe / C / S / R LOCALMACHINE MY

结果是9B088F80 A4FC3141 28F62890 70BA1FC4 49FDD009。后来我才知道我需要删除的空间使用指纹时。

2)删除任何证书由执行在高架的命令行提示符下键入以下链接端口443:

  netsh的HTTP删除的sslcert ipport = 0.0.0.0:443

3)运行关闭VS2010工具菜单中创建GUID生成新的GUID。在我的情况我
B0421A5B-FF61-47CE-892D-11AA3A9C7D2A。

4)安装通过执行在高架的命令行提示符下键入以下的自签名证书到端口443:

 的netsh的http添加的sslcert ipport = 0.0.0.0:443 CERTHASH = 9B088F80A4FC314128F6289070BA1FC449FDD009的appid = {B0421A5B-FF61-47CE-892D-11AA3A9C7D2A}

5)修改ACL的运行从提升的命令行提示符下输入:

 的netsh的http添加urlacl URL = https://开头本地主机:443 / USER =大家

6)加入了443端口和HTTPS协议的绑定修改IIS的防爆preSS的application.config文件。该文件的网站部分弄成这样看:

 <网站及GT;
        <网站名称=开发网站ID =1serverAutoStart =真>
            <应用路径=/>
                < virtualDirectory路径=/physicalPath =%IIS_BIN%\\ AppServer的\\ empty_wwwroot/>
            < /用途>
            <&绑定GT;
                <绑定协议=htt​​ps开头bindingInformation =*:443:本地主机/>
                <绑定协议=HTTPbindingInformation =*:80:本地主机/>
            < /绑定>
        < /网站>
        < siteDefaults>
            <日志文件的LogFormat =W3C目录=%IIS_USER_HOME%\\日志/>
            < traceFailedRequestsLogging目录=%IIS_USER_HOME%\\ TraceLogFiles启用=真maxLogFileSizeKB =1024/>
        < / siteDefaults>
        < applicationDefaults applicationPool =IISEx pressAppPool/>
        < virtualDirectoryDe​​faults allowSubDirConfig =真/>
    < /网站>

7)通过执行以下在提升的命令行提示重新启动http服务

 净停止HTTP
NET START HTTP

8)变更的项目URL我的MVC项目的属性页下面的Web选项卡上:

 的http://本地主机/

保存项目属性页触发服务器的重新配置后,我做了这个变化。

当我从VS2010中启动该MVC应用程序它正确绑回的http://本地主机(的80端口,默认;我没有包括获取IIS防爆preSS在端口80不安全/连接正常工作的所有步骤,但他们基本上是步骤5到7,但侧重于HTTP和80端口,而不是HTTPS和端口443)。

但是,试图转型到需要HTTPS的任何行动让我一个服务器拒绝连接的错误。

我在做什么错了?


解决方案

您已经设置了一个项目,使用IISEx preSS,preSS F4后而该项目在解决方案资源管理器打开属性和设置的属性选择 SSL启用设置真正和在 SSL网址与您要为SSL(在你的案件443)端口设置的URL。

这对我的作品没有引擎盖下将和自签名证书是自动的。

要运行该URL默认的项目,您可以右键单击该项目,选择属性,然后网络和的 https://开头本地主机:443

I am unable to get IIS Express to accept secure connections for a VS2010 MVC3 project that I'm developing. I can get it to accept unsecure connections on port 80, but not secure on port 443.

I've taken the following steps, based on googling:

1) Located the SHA1 thumbprint for my IIS Express Server self-signed certificate via executing the following on a VS2010 commandline:

certmgr.exe /c /s /r localMachine MY

The result was 9B088F80 A4FC3141 28F62890 70BA1FC4 49FDD009. I learned later that I need to delete the spaces when using the thumbprint.

2) Deleted whatever certificate was linked to port 443 by executing the following on an elevated commandline prompt:

netsh http delete sslcert ipport=0.0.0.0:443

3) Generated a new GUID by running Create GUID off the VS2010 Tools menu. In my case I got B0421A5B-FF61-47CE-892D-11AA3A9C7D2A.

4) Installed the self-signed certificate to port 443 by executing the following on an elevated commandline prompt:

netsh http add sslcert ipport=0.0.0.0:443 certhash=9B088F80A4FC314128F6289070BA1FC449FDD009 appid={B0421A5B-FF61-47CE-892D-11AA3A9C7D2A}

5) Modified the ACL by running the following from an elevated commandline prompt:

netsh http add urlacl url=https://localhost:443/ user=everyone

6) Modified the application.config file for IIS Express by adding a binding for port 443 and the https protocol. The sites section for the file ended up looking like this:

        <sites>
        <site name="Development Web Site" id="1" serverAutoStart="true">
            <application path="/">
                <virtualDirectory path="/" physicalPath="%IIS_BIN%\AppServer\empty_wwwroot" />
            </application>
            <bindings>
                <binding protocol="https" bindingInformation="*:443:localhost" />
                <binding protocol="http" bindingInformation="*:80:localhost" />
            </bindings>
        </site>
        <siteDefaults>
            <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
            <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
        </siteDefaults>
        <applicationDefaults applicationPool="IISExpressAppPool" />
        <virtualDirectoryDefaults allowSubDirConfig="true" />
    </sites>

7) Restarted the http service by executing the following at an elevated commandline prompt:

net stop http
net start http

8) Changed the Project URL on the Web tab of my MVC project's Property page to the following:

http://localhost/

Saving the project property page triggered a reconfiguration of the server after I made this change.

When I launch the MVC app from within VS2010 it correctly ties back to http://localhost (on port 80, the default; I haven't included all the steps for getting IIS Express to work with unsecure/normal connections on port 80, but they're essentially steps 5 thru 7, but focusing on http and port 80, not https and port 443).

However, trying to transition to any action that requires https gets me a "server refused connection" error.

What am I doing wrong?

解决方案

After you've set a project to use IISExpress, press F4 while the project is selected on the solution explorer to bring up the properties and in the properties set SSL Enable set true and under SSL URL set the URL with the port (443 in your case) you want for the SSL.

This works for me without going under the hood and the self signed certificate was automatic.

To run the project on that URL by default, you can right click on the project, select properties, then Web and replace the Project Url with https://localhost:443

这篇关于IIS防爆preSS - 获取SSL上班的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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