在IIS上开启https服务

来源:互联网 发布:tomcat配置多域名访问 编辑:程序博客网 时间:2024/06/05 09:17

发贴心情 在IIS上开启https服务。

前两天因为需要修正一个Windows Live Contacts Gadget在https连接下无法工作的错误,在dev machine的IIS上设置了一下SSL功能。

大家都知道要开启SSL服务关键需要两个东西:

1. A Certificate Authority (such VeriSign.com)

2. A site certificate

如果你使用的是Windows Server 2003或者XP Advanced Server,你其实可以利用系统提供的“Certificate Services”服务来“冒充”一个CA并给自己发一个site certificate,这里有一个tutorial:

Building your own certificate authority: http://searchwindowssecurity.techtarget.com/tip/1,289483,sid45_gci1110403,00.html 

如果你使用的是XP Professional,就没有CA服务了。但作为程序调试或测试用的话,其实就只需要生成一个self-signed certificate就可以了。等browser提示你是否接受这个untrusted certificate的时候,只要选Yes就行。

生成self-signed certificate有很多方法。稍微繁琐一点的可以用OpenSSL (OpenSSL for windows: http://www.openssl.org/related/binaries.html)或者keytool (http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/keytool.html)来sign一个certificate,然后再在IIS中导入这个certificate就行了。如果你想对IIS的相关设置有所了解的话,可以试试做一遍,这里也有一个tutorial:

Enabling SSL in IIS on Windows XP Professional: http://www.somacon.com/p41.php

当然,如果你想省掉所有这些麻烦也行,最简单的在IIS启动SSL的方法只要3步:

1. 下载 IIS 6.0 Resource Kit Tools: http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499&DisplayLang=en
2. 安装.
3. “All Programs->IIS Resources->SelfSSL->SelfSSL”, 在命令行中键入 “selfssl”, 回答 “y”, and you are done.


现在你试试在browser里访问:https://localhost,你会发现会出现一个窗口询问是否接受一个untrusted certificate,选Yes, and you are in a safe channel now.

原创粉丝点击