我有一個我想使用SSL訪問的WCF服務。我在我的開發人員機器上,所以我正在考慮自行託管該服務。我一直在關注Configuring HTTP and HTTPS。使用SSL和WCF進行自託管 - 無法將證書綁定到端口
我創建了一個自簽名證書,我將其添加到受信任根證書頒發機構。我創建了另外兩個由第一個簽名的證書,一個用於客戶端,另一個用於服務器。我跟着Using makecert to create certificates for development。
我無法超越SSL證書配置步驟。當我的證書綁定使用netsh它拋出一個SSL錯誤的端口號:
Certificate add failed, Error: 1312 A specified logon session does not exist. It may already have been terminated.
是否證書需要爲此一些特殊領域或其他一些東西的工作?
CA證書:
makecert -n "CN=TestCA" -cy authority -a sha1 -sv "TestCA.pvk" -r "TEST_CA.cer"
服務證書:
makecert -n "CN=rneapp.com" -ic "TEST_CA.cer" -iv "TestCA.pvk" -a sha1 -sky exchange -pe -sv "rneapp.com.pvk" "rneapp.com.cer"
客戶端證書:
makecert -n "CN=rneClient" -ic "TEST_CA.cer" -iv "TestCA.pvk" -a sha1 -sky exchange -pe -sv "rneClient.pvk" "rneClient.cer"
我使用這個命令將證書到端口綁定:
netsh http add sslcert ipport=0.0.0.0:8465 certhash=a853f3b5b48b8a506bdc4212ba2726a3bfea2bb6 appid={2E53B9B0-17AE-4EBC-A1AE-43D53A6FD07D} clientcertnegotiation=enable
你是如何確定最後命令的appid的? – Paul 2011-07-18 02:15:17
我爲appid生成了一個GUID。 http://stackoverflow.com/questions/537173/what-appid-should-i-use-with-netsh-exe – Megacan 2011-07-27 15:54:01
你應該能夠從AssemblyInfo.cs/vb文件獲得appid – rotard 2012-02-03 22:05:00