diff --git a/Assets/Cryville/Common/Network/TlsTcpClient.cs b/Assets/Cryville/Common/Network/TlsTcpClient.cs index 53d967b..45ad331 100644 --- a/Assets/Cryville/Common/Network/TlsTcpClient.cs +++ b/Assets/Cryville/Common/Network/TlsTcpClient.cs @@ -6,6 +6,7 @@ using System.Collections; using System.IO; using System.Linq; using System.Net.Sockets; +using System.Text; namespace Cryville.Common.Network { public class TlsTcpClient { @@ -16,7 +17,7 @@ namespace Cryville.Common.Network { public TlsTcpClient(string hostname, int port) { _tcpClient = new TcpClient(hostname, port); _protocol = new TlsClientProtocol(_tcpClient.GetStream()); - _tlsClient = new InternalTlsClient(new BcTlsCrypto(new SecureRandom())); + _tlsClient = new InternalTlsClient(hostname, new BcTlsCrypto(new SecureRandom())); } public void Connect() { @@ -29,7 +30,11 @@ namespace Cryville.Common.Network { } private class InternalTlsClient : DefaultTlsClient { - public InternalTlsClient(TlsCrypto crypto) : base(crypto) { } + string _host; + + public InternalTlsClient(string host, TlsCrypto crypto) : base(crypto) { + _host = host; + } protected override ProtocolVersion[] GetSupportedVersions() { return ProtocolVersion.TLSv13.DownTo(ProtocolVersion.TLSv12); @@ -37,8 +42,7 @@ namespace Cryville.Common.Network { protected override IList GetProtocolNames() { IList list = new ArrayList { - ProtocolName.Http_1_1, - ProtocolName.Http_2_Tls + ProtocolName.Http_1_1 }; return list; } @@ -62,6 +66,10 @@ namespace Cryville.Common.Network { return result; } + protected override IList GetSniServerNames() { + return new ArrayList { new ServerName(0, Encoding.ASCII.GetBytes(_host)) }; + } + public override TlsAuthentication GetAuthentication() { return new NullTlsAuthentication(); } diff --git a/Assets/Cryville/Crtr/Console.cs b/Assets/Cryville/Crtr/Console.cs index 3cc953c..c6b6983 100644 --- a/Assets/Cryville/Crtr/Console.cs +++ b/Assets/Cryville/Crtr/Console.cs @@ -26,6 +26,10 @@ namespace Cryville.Crtr { worker.Activate(); } + void OnApplicationQuit() { + Game.Shutdown(); + } + public void Submit() { worker.Issue(InputBox.text); }