다음을 통해 공유


SSLBinding.Create Method1

SSL(Secure Sockets Layer) 바인딩을 만듭니다.

구문

oWebAdmin.Get("SSLBinding").Create(  
   IPAddress,  
   Port,  
   CertificateHash,  
   StoreName  
);  
oWebAdmin.Get("SSLBinding").Create  
   IPAddress,  
   Port,  
   CertificateHash,  
   StoreName  
  

매개 변수

속성 Description
CertificateHash string SSL 바인딩에 대한 인증서 해시를 지정하는 값입니다.
IPAddress string SSL 바인딩의 IP 주소를 지정하는 값입니다.
Port uint32 SSL 바인딩의 포트 번호를 지정하는 값입니다.
StoreName string SSL 바인딩에 대한 인증서 저장소의 이름을 지정하는 값입니다.

반환 값

이 메서드는 값을 반환하지 않습니다.

설명

다음 스크립트는 매개 변수에 사용할 수 있는 다양한 형식을 IPAddress 보여 줍니다.

' This is the standard format for a specific IP address.  
oWebAdmin.Get("SSLBinding").Create "172.30.190.122", 443, "fbbca460988a482227ec71122177045e47f9f2ff", "MyStoreName"  
  
' Each of the following formats is an acceptable way to create a secure binding   
' to port 443 on all IP addresses.  
oWebAdmin.Get("SSLBinding").Create "*", 443, "fbbca460988a482227ec71122177045e47f9f2ff", "MyStoreName"  
oWebAdmin.Get("SSLBinding").Create "0.0.0.0", 443, "fbbca460988a482227ec71122177045e47f9f2ff", "MyStoreName"  
oWebAdmin.Get("SSLBinding").Create "", 443, "fbbca460988a482227ec71122177045e47f9f2ff", "MyStoreName"  

예제

다음 예제에서는 보안 바인딩을 만들고 웹 사이트에 추가합니다.

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Create the secure binding.  
oWebAdmin.Get("SSLBinding").Create "*", 443, "fbbca460988a482227ec71122177045e47f9f2ff", "MyStoreName"  
  
' Create a new binding element.  
Set oBinding = oWebAdmin.Get("BindingElement").SpawnInstance_  
oBinding.BindingInformation = "*:443:"  
oBinding.Protocol = "https"  
  
' Get the default Web site.  
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")  
  
' Increase the size of the array in the site's Bindings property.  
arrBindings = oSite.Bindings  
ReDim Preserve arrBindings(UBound(arrBindings) + 1)  
  
' Add the new binding to the array.   
Set arrBindings(UBound(arrBindings)) = oBinding  
  
' Assign the array to the Site.Bindings property.  
oSite.Bindings = arrBindings   
Set oPath = oSite.Put_  
  

요구 사항

형식 Description
클라이언트 - Windows Vista의 IIS 7.0
- Windows 7의 IIS 7.5
- Windows 8의 IIS 8.0
- WINDOWS 10 IIS 10.0
서버 - Windows Server 2008의 IIS 7.0
- Windows Server 2008 R2의 IIS 7.5
- Windows Server 2012의 IIS 8.0
- Windows Server 2012 R2의 IIS 8.5
- WINDOWS SERVER 2016 IIS 10.0
제품 - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
MOF 파일 WebAdministration.mof

참고 항목

BindingElement 클래스
SSLBinding 클래스
사이트 클래스