35 lines
652 B
C#
35 lines
652 B
C#
using Microsoft.Win32;
|
|
using System;
|
|
using System.IO;
|
|
|
|
namespace Cryville.Common.Network {
|
|
public class HttpsClient : HttpClient {
|
|
readonly TlsTcpClient _tlsTcpClient;
|
|
|
|
protected override Stream Stream {
|
|
get {
|
|
return _tlsTcpClient.Stream;
|
|
}
|
|
}
|
|
protected override string WindowsProxyProtocolName {
|
|
get {
|
|
return "https";
|
|
}
|
|
}
|
|
|
|
public HttpsClient(Uri baseUri) : base(baseUri, 443) {
|
|
_tlsTcpClient = new TlsTcpClient(TcpClient, baseUri.Host);
|
|
}
|
|
|
|
public override void Connect() {
|
|
base.Connect();
|
|
_tlsTcpClient.Connect();
|
|
}
|
|
|
|
public override void Close() {
|
|
_tlsTcpClient.Close();
|
|
base.Close();
|
|
}
|
|
}
|
|
}
|