How to test SSL switching using VS2010 on Win7

2019-07-09 03:24发布

I developed a large web application with VS2008 installed on an old Win2k3 server. I now have Visual Studio 2010 installed on Win7 Pro and work on the application fine. Parts of my web application need to switch into and out of SSL which they did on the Win2k3 server using the IIS tool that creates a private SSL cert. However I now need to make changes to those parts and now NEED to be able to test it on the VS2010 internal web server as I no longer have a dev web server like I used to. Is there any way I can do this or is it definitely a no no?

2条回答
Luminary・发光体
2楼-- · 2019-07-09 04:03

Please take a look here. It is mentioned:

This sample [some sample using HTTPS] only works when hosted on IIS and cannot work on Cassini – Visual Studio Development Server because Cassini does not support HTTPS.

As this sample is related to .Net Framework 4, I assume that Visual Studio 2010 does not support SSL.

EDIT: The good news is that you can enable SSL for IIS 7.0 (and above). You can find detailed instructions here.

When are done you should be able to access your website over SSL, but browsers will display a warning that says that your certificate is not trusted. However, this can be easily solved in the following way:

1) The common name (CN) for the self-signed certificate that you create for the website should match the computer name that runs IIS and you should access the site using the computer name (https://computerName/ not https://localhost/ or https://IP/)

2) Export the certificate from IIS and import it in the browsers certificate stores. For Internet Explorer the certificate must be added to Windows Certificate Store at Local Computer / Trusted Root Certification Authorities (use Windows Management Console). For other browsers, because they use custom certificate store, the certificate must be imported in their specific location. For example, in case of Firefox to import a certificate go to Tools->Option->Advanced->Encryption->View Certificates->Authorities->Import.

查看更多
闹够了就滚
3楼-- · 2019-07-09 04:27

With the release of VS2010SP1 & IIS Express you can now to debug code that uses with https/SSL without having to use a FULL IIS server.

查看更多
登录 后发表回答