mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-12 23:44:59 +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;
|
||||
|
||||
Reference in New Issue
Block a user