self-created SSL(무료)을 사용하거나
구매한 SSL을 사용해서
https endpoint config하는데 사용할수있다.
SSL은 도메인 레벨로 구매될수있는데
Standard SSL은 기본 도메인 (mycompany.com 아니면 www.mycompany.com) 만 secure 가능.
Wildcard SSl은 기본도메일 + 서브 도메인 (sub.mycompany.com) secure 가능.
azure hosted service가 보통 sub.cloudapp.net인데 cloudapp.net이 마이크로소프트 도메인이니
그 도메인 커버하는 SSL는 구매 불가능.
CNAME을 이용해서 config 해줘야함.
mycompany도메인 wildcard SSL을 구매한후
CNAME을 sub.cloudapp.net -> sub.mycompany.com 으로 지정하면 됨.
순서:
1. buy ssl credit
2. using IIS on local server (run as admin), create a CSR
wildcard SSL을 사용하려면 "*.mycompany.com" 로 써야함. 나머지 정보는 도메인이 레지스터 된 정보에 맞춰서 입력.
Cryptographic service provider: Microsoft RSA Schannel Cryptographic Provider
Bit length: 2048
이름주고 그냥 텍스트파일로 저장.
저장한 텍스트파일 열어서 전체 복사 (----- BEGIN 이 부분도 포함).
3. with this CSR, use the SSl credit to create a SSL
4. Once everything is approved, download the SSL

다운로드 할때 무슨플렛폼이용할꺼냐고 물어보면 "IIS7" 선택후 다운로드.
ZIP 파일로 다운되는데, 언집 시키면 두개 cert가 포함되있다 (intermediate cert -PKCS7 type- and crt type)

5. using MMC console, install intermediate certs on the local server
windows key + r > mmc 타입쳐서 MMC 콘솔을 열어서, File > Add/Remove Snap-ins > Certificates > Add (pick "Computer account") > Local computer > Ok
왼쪽 네비게이션에서 Certificates/Intermediate Certification Authorities/Certificates, right-click > All Task > Import. 그리곤 아까 다운로드하고 언집한 intermediates.p7b를 고른후 ok.
intermediate cert 설치전:
intermediate cert 설치후:
6. using IIS on local server (run as admin), complete the CSR process 함으로써 진짜 cert(.crt type)를 설치
7. go back and using MMC (Certificates/Personal/Certification), right-click on the cert and export the certificate (pfx) with a pw (select "Yes, export the private key" option)
8. upload the certificate to azure
총 3개 cert가 생성된게 보일것.
9. on your project, add the certificate thumbnail and configure endpoints
비쥬얼스튜디오 web role property view에서 Certificate tab > Add a new certificate
Name: mycompany.com, Store Location: LocalMachine, Store Name: My, thumbprint: <copy from azure portal>
나머지 두개 certificate도 같은 형식으로 Store Name만 Trust 고른후 추가.
10. 비쥬열스튜디오 web role property view에서 Endpoint tab으로 가서
Http와 Https endpoint를 config 해준다.
Name: HttpIn, Type: Input, Protocol: http, Public port: 80
Name: HttpsIn, Type: Input, Protocol: https, Public port: 443, SSL Certificate name에서 아까 추가한 첫번째 cert를 골라준다.
참고: http://amusedia.blogspot.com/2011/10/setting-up-secure-windows-azure-web.html
Note #1: 모든 incoming http connection을 https로 forward 하려면,
http with port 80, https with port 443 (default port) 둘다 모두 연다음에
web role로 지정된 프로젝트의 web.config 파일에 URL Rewrite 부분을 추가해주면 됨:
Note #2: CNAME은 host만 forward 시키지 port number는 forward 시키지 않음
Note #3: Chained Certificate 는 위 처럼 intermediate cert같은거를 chain cert로 이용하는것