using System;
using System.IO;

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

		public HttpsClient(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();
		}
	}
}
