using System;
using System.IO;

namespace Cryville.Common.Network.Http11 {
	public class Https11Client : Http11Client {
		readonly TlsClient _tlsClient;
		
		protected override Stream Stream {
			get {
				return _tlsClient.Stream;
			}
		}
		protected override string WindowsProxyProtocolName {
			get {
				return "https";
			}
		}

		public Https11Client(Uri baseUri) : base(baseUri, 443) {
			_tlsClient = new TlsClient(RawTcpStream, baseUri.Host);
		}

		public override void Connect() {
			base.Connect();
			_tlsClient.Connect();
		}

		public override void Close() {
			_tlsClient.Close();
			base.Close();
		}
	}
}
