標籤:style blog http io os ar 使用 for sp
原創地址:http://www.cnblogs.com/jfzhu/p/4064654.html
轉載請註明出處
有關HTTPS、SSL以及SSL認證的工作原理,參見
《HTTPS那些事(一)HTTPS原理》
《HTTPS那些事(二)SSL認證》
《HTTPS那些事(三)攻擊執行個體與防禦》
本文將示範如何在IIS中配置一個HTTPS的ASP.NET Web Application。
(1)開啟Internet Information Services (IIS) Manager
(2)建立一個Self-Signed Certificate
A self-signed certificate is an identity certificate that is signed by its own creator. Certificates are signed by Certificate Authority. In general self signed certificates are fine for testing purpose but not for production.
建立self-signed certificate有兩種方式:
- 使用IIS
- 使用Visual Studio的工具MakeCert.exe
本文只示範如何用IIS建立self-signed certificate。
開啟IIS Manager後,雙擊Server Certificates。
(3)在IIS中添加一個Website
Binding下Type選擇https,預設連接埠為443(http預設連接埠為80),SSL Certificate選擇上面我們建立的self-signed certificate。
(4)也可以用添加Site Binding的方式實現
點擊Add
(5)開啟瀏覽器
點擊地址欄旁邊的小鎖頭,查看一下認證
(6)開啟認證管理工具,查看Trusted Root Certification Authorities
可以看到在IIS中建立self-signed certificate的時候,伺服器已經將它添加到Trusted Root CA中了。在用戶端,你需要手動安裝根憑證。
(7)憑證授權單位
如果想使用瀏覽器信任的認證,需要使用憑證授權單位 (CA)頒發給你的認證,比如Verisign,Thawte等。Self-signed Certificate可以用於開發測試環境,不應用於生產環境。
Step by Step 配置使用HTTPS的ASP.NET Web應用