mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-09 22:15:00 +03:00
Optimize Cert Pinning (#8282)
This commit is contained in:
@@ -261,13 +261,7 @@ public partial class CoreConfigSingboxService
|
||||
}
|
||||
if (node.StreamSecurity == Global.StreamSecurity)
|
||||
{
|
||||
var certs = node.Cert
|
||||
?.Split("-----END CERTIFICATE-----", StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(s => s.TrimEx())
|
||||
.Where(s => !s.IsNullOrEmpty())
|
||||
.Select(s => s + "\n-----END CERTIFICATE-----")
|
||||
.Select(s => s.Replace("\r\n", "\n"))
|
||||
.ToList() ?? new();
|
||||
var certs = CertPemManager.ParsePemChain(node.Cert);
|
||||
if (certs.Count > 0)
|
||||
{
|
||||
tls.certificate = certs;
|
||||
|
||||
@@ -245,13 +245,6 @@ public partial class CoreConfigV2rayService
|
||||
var host = node.RequestHost.TrimEx();
|
||||
var path = node.Path.TrimEx();
|
||||
var sni = node.Sni.TrimEx();
|
||||
var certs = node.Cert
|
||||
?.Split("-----END CERTIFICATE-----", StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(s => s.TrimEx())
|
||||
.Where(s => !s.IsNullOrEmpty())
|
||||
.Select(s => s + "\n-----END CERTIFICATE-----")
|
||||
.Select(s => s.Replace("\r\n", "\n"))
|
||||
.ToList() ?? new();
|
||||
var useragent = "";
|
||||
if (!_config.CoreBasicItem.DefUserAgent.IsNullOrEmpty())
|
||||
{
|
||||
@@ -284,6 +277,7 @@ public partial class CoreConfigV2rayService
|
||||
{
|
||||
tlsSettings.serverName = Utils.String2List(host)?.First();
|
||||
}
|
||||
var certs = CertPemManager.ParsePemChain(node.Cert);
|
||||
if (certs.Count > 0)
|
||||
{
|
||||
var certsettings = new List<CertificateSettings4Ray>();
|
||||
|
||||
Reference in New Issue
Block a user