HttpListenerRequest.IsSecureConnection 속성

정의

요청을 보내는 데 사용된 TCP 연결이 SSL(Secure Sockets Layer) 프로토콜을 사용하는지 여부를 나타내는 Boolean 값을 가져옵니다.

public:
 property bool IsSecureConnection { bool get(); };
public bool IsSecureConnection { get; }
member this.IsSecureConnection : bool
Public ReadOnly Property IsSecureConnection As Boolean

속성 값

TCP 연결이 SSL을 사용하면 true이고, 그렇지 않으면 false입니다.

예제

다음 코드 예제는 IsSecureConnection 속성입니다.

public static void ShowRequestProperties2 (HttpListenerRequest request)
{
    Console.WriteLine("KeepAlive: {0}", request.KeepAlive);
    Console.WriteLine("Local end point: {0}", request.LocalEndPoint.ToString());
    Console.WriteLine("Remote end point: {0}", request.RemoteEndPoint.ToString());
    Console.WriteLine("Is local? {0}", request.IsLocal);
    Console.WriteLine("HTTP method: {0}", request.HttpMethod);
    Console.WriteLine("Protocol version: {0}", request.ProtocolVersion);
    Console.WriteLine("Is authenticated: {0}", request.IsAuthenticated);
    Console.WriteLine("Is secure: {0}", request.IsSecureConnection);
}
Public Shared Sub ShowRequestProperties2(ByVal request As HttpListenerRequest)
    Console.WriteLine("KeepAlive: {0}", request.KeepAlive)
    Console.WriteLine("Local end point: {0}", request.LocalEndPoint.ToString())
    Console.WriteLine("Remote end point: {0}", request.RemoteEndPoint.ToString())
    Console.WriteLine("Is local? {0}", request.IsLocal)
    Console.WriteLine("HTTP method: {0}", request.HttpMethod)
    Console.WriteLine("Protocol version: {0}", request.ProtocolVersion)
    Console.WriteLine("Is authenticated: {0}", request.IsAuthenticated)
    Console.WriteLine("Is secure: {0}", request.IsSecureConnection)
End Sub

설명

보안 연결을 요청하기 위해 클라이언트 요청은 대신 UriSchemeHttp를 사용합니다UriSchemeHttps. SSL을 사용하여 연결을 설정할 수 없는 경우 클라이언트는 오류에 대한 정보를 제공하는 을 받 WebException 습니다.

적용 대상

추가 정보