mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-28 05:03:02 +00:00
Add IP cert support
This commit is contained in:
parent
b5800f7dfc
commit
e0c0825313
2 changed files with 3 additions and 17 deletions
|
|
@ -215,7 +215,7 @@ public class CertPemManager
|
|||
using var client = new TcpClient();
|
||||
await client.ConnectAsync(domain, port > 0 ? port : 443, cts.Token);
|
||||
|
||||
using var ssl = new SslStream(client.GetStream(), false, ValidateServerCertificate);
|
||||
await using var ssl = new SslStream(client.GetStream(), false, ValidateServerCertificate);
|
||||
|
||||
var sslOptions = new SslClientAuthenticationOptions
|
||||
{
|
||||
|
|
@ -262,7 +262,7 @@ public class CertPemManager
|
|||
using var client = new TcpClient();
|
||||
await client.ConnectAsync(domain, port > 0 ? port : 443, cts.Token);
|
||||
|
||||
using var ssl = new SslStream(client.GetStream(), false, ValidateServerCertificate);
|
||||
await using var ssl = new SslStream(client.GetStream(), false, ValidateServerCertificate);
|
||||
|
||||
var sslOptions = new SslClientAuthenticationOptions
|
||||
{
|
||||
|
|
@ -280,11 +280,7 @@ public class CertPemManager
|
|||
var chain = new X509Chain();
|
||||
chain.Build(certChain);
|
||||
|
||||
foreach (var element in chain.ChainElements)
|
||||
{
|
||||
var pem = ExportCertToPem(element.Certificate);
|
||||
pemList.Add(pem);
|
||||
}
|
||||
pemList.AddRange(chain.ChainElements.Select(element => ExportCertToPem(element.Certificate)));
|
||||
|
||||
return (pemList, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,11 +247,6 @@ public class AddServerViewModel : MyReactiveObject
|
|||
{
|
||||
serverName = SelectedSource.Address;
|
||||
}
|
||||
if (!Utils.IsDomain(serverName))
|
||||
{
|
||||
UpdateCertTip(ResUI.ServerNameMustBeValidDomain);
|
||||
return;
|
||||
}
|
||||
if (SelectedSource.Port > 0)
|
||||
{
|
||||
domain += $":{SelectedSource.Port}";
|
||||
|
|
@ -277,11 +272,6 @@ public class AddServerViewModel : MyReactiveObject
|
|||
{
|
||||
serverName = SelectedSource.Address;
|
||||
}
|
||||
if (!Utils.IsDomain(serverName))
|
||||
{
|
||||
UpdateCertTip(ResUI.ServerNameMustBeValidDomain);
|
||||
return;
|
||||
}
|
||||
if (SelectedSource.Port > 0)
|
||||
{
|
||||
domain += $":{SelectedSource.Port}";
|
||||
|
|
|
|||
Loading…
Reference in a new issue