mirror of https://github.com/2dust/v2rayN
Add tls13 settings in the registry
parent
88e2288298
commit
0a1d4d5193
|
@ -176,6 +176,10 @@ namespace v2rayN
|
|||
/// </summary>
|
||||
public const string MyRegKeyLanguage = "CurrentLanguage";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string MyRegKeySecurityProtocolTls13 = "SecurityProtocolTls13";
|
||||
/// <summary>
|
||||
/// Icon
|
||||
/// </summary>
|
||||
public const string CustomIconName = "v2rayN.ico";
|
||||
|
|
|
@ -353,7 +353,7 @@ namespace v2rayN
|
|||
return $"{string.Format("{0:f1}", result)} {unit}";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static string UrlEncode(string url)
|
||||
{
|
||||
|
@ -717,8 +717,9 @@ namespace v2rayN
|
|||
|
||||
public static void SetSecurityProtocol()
|
||||
{
|
||||
//.NET Framework 4.8
|
||||
if (GetDotNetRelease(528040))
|
||||
string securityProtocolTls13 = RegReadValue(Global.MyRegPath, Global.MyRegKeySecurityProtocolTls13, "0");
|
||||
|
||||
if (securityProtocolTls13.Equals("1"))
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
|
||||
| SecurityProtocolType.Tls
|
||||
|
@ -735,6 +736,26 @@ namespace v2rayN
|
|||
}
|
||||
ServicePointManager.DefaultConnectionLimit = 256;
|
||||
}
|
||||
|
||||
public static bool PortInUse(int port)
|
||||
{
|
||||
bool inUse = false;
|
||||
|
||||
IPGlobalProperties ipProperties = IPGlobalProperties.GetIPGlobalProperties();
|
||||
IPEndPoint[] ipEndPoints = ipProperties.GetActiveTcpListeners();
|
||||
|
||||
var lstIpEndPoints = new List<IPEndPoint>(IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners());
|
||||
|
||||
foreach (IPEndPoint endPoint in ipEndPoints)
|
||||
{
|
||||
if (endPoint.Port == port)
|
||||
{
|
||||
inUse = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return inUse;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 杂项
|
||||
|
@ -913,7 +934,7 @@ namespace v2rayN
|
|||
{
|
||||
var logger = LogManager.GetLogger("Log2");
|
||||
logger.Debug(strTitle);
|
||||
logger.Debug(ex);
|
||||
logger.Debug(ex);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Reference in New Issue