Windows Azure Cloud Service (36) 在Azure Cloud Service配置SSL認證

來源:互聯網
上載者:User

標籤:style   blog   http   color   os   使用   strong   ar   for   

  《Windows Azure Platform 系列文章目錄》

 

  在某些時候,我們需要在Azure PaaS Cloud Service配置HTTPS串連。本章將介紹如何在本地建立認證,然後使用HTTPS串連Azure Cloud Service。

  1.建立認證

  以管理員身份運行CMD,使用Makecert命令,安裝Azure認證。具體的命令如下:

makecert -sky exchange -r -n "CN=<CertificateName>" -pe -a sha1 -len 2048 -ss My "<CertificateName>.cer"

  比如我建立一個認證名叫SSLCertificate

makecert -sky exchange -r -n "CN=SSLCertificate" -pe -a sha1 -len 2048 -ss My "SSLCertificate.cer"

   

  2.匯出私密金鑰

  在運行裡,輸入mmc.exe

  在控制台,選擇檔案->添加刪除嵌入式管理單元,添加"認證",選擇"我的使用者賬戶"

  展開"認證-目前使用者"->"個人"->"認證"。選擇SSLCertificate,右鍵"所有任務",點擊"匯出"

  選擇"是,匯出私密金鑰”,輸入自己的私密金鑰(本文使用123456)。然後將pfx儲存到C盤的根目錄,重新命名為PrivateCertificate.pfx。

 

  3.建立空的Cloud Service

  在Windows Azure Portal,建立一個空的雲端服務,命名為LeiSSL。如:

  

 

  4.點擊Cloud Service,選擇我在步驟三建立的LeiSSL,然後點擊Certificates,最後選擇Upload a certificate

  

  

  上傳完畢後,可以查看到ThumbPrint,如:

  

 

  5.將我們儲存在C:\PrivateCertificate.pfx的檔案進行上傳,同時輸入你在步驟二裡匯出的私密金鑰。如:

  

 

  6.然後在本地,使用管理員身份,運行VS2013。建立一個Cloud Project,並且添加ASP.NET Web Role

  7.在專案檔裡,選擇WindowsAzure1,Role,雙擊WebRole1

  

  

  8.在Certificates功能表列,點擊Add Certificate,將步驟4的Thumbprint輸入到儲存格中

  

  

  9.再點擊Endpoints功能表列,點擊Add Certificate,設定名稱為HttpsEndpoint,Protocol設定為https,SSL Certificate Name選擇我在步驟8中建立的Certificate1

  

 

  10.設定完畢後,用VS2013發布Cloud Service

  關於發布的步驟,請參考[SDK2.2]Windows Azure Cloud Service (35) 使用VS2013發布Azure Cloud Service

 

  11.我們可以通過https://leissl.cloudapp.net:8080/ 來訪問發布成功的應用程式

  

 

Windows Azure Cloud Service (36) 在Azure Cloud Service配置SSL認證

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.