简体   繁体   English

asp.net网站的HTTPS安全连接配置

[英]HTTPS secure connection configuration for asp.net web site

I have developed one site in asp.net (C#).我在asp.net (C#) 中开发了一个站点。

Now, I want to access my site with https://www.mysite.com & https://localhost/mywebsite现在,我想使用https://www.mysite.comhttps://localhost/mywebsite访问我的网站

Please suggest me how to config the secure connection.请建议我如何配置安全连接。

And, for this need to config in IIS-Manager level or Can we manage in code level also?而且,为此需要在 IIS 管理器级别进行配置,或者我们也可以在代码级别进行管理吗?

Can any one please suggest me.任何人都可以请建议我。

Thanks in adv.感谢广告。

See this link of scott hanselman. 请参阅scott hanselman的此链接。 It explains how to setup iis express for ssl as well as hosting it by computer name. 它说明了如何为ssl设置iis express以及如何通过计算机名托管它。

http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx

if you are hosting your local site (dev version) on IIS then: 如果要在IIS上托管本地站点(开发版本),则:

  1. Go to IIS Manager, click on the top node (your server name) 转到IIS管理器,单击顶部节点(您的服务器名称)

  2. in the section on the right, double click on Server Certificates 在右侧部分中,双击“服务器证书”

  3. in the Actions pane on far right, click on "Create Self-Signed Certificate" 在最右边的“操作”窗格中,单击“创建自签名证书”

  4. give your certificate a name eg: "MyDevCert", and click okay 给您的证书起一个名字,例如:“ MyDevCert”,然后单击“确定”。

  5. right click on your IIS WebSite, and choose "Edit Bindings" 右键单击IIS网站,然后选择“编辑绑定”

  6. click on "ADD" button 点击“添加”按钮

  7. choose https from Type dropdown, then choose your newly created certificate in this case "MyDevCert" from the SSL certificate drop down 从类型下拉菜单中选择https,然后在这种情况下从SSL证书下拉列表中选择新创建的证书“ MyDevCert”

  8. press okay, press close ... restart IIS 按确定,按关闭...重新启动IIS

you should now be able to browser to https://localhost 您现在应该能够浏览到https://localhost

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM