增加TLS兼容
This commit is contained in:
parent
dda0aa0aa2
commit
f2d00d0fa9
@ -354,6 +354,8 @@ namespace FlyDockTool
|
||||
}
|
||||
|
||||
public static string PostMoths(string url, string param)
|
||||
{
|
||||
try
|
||||
{
|
||||
string strURL = url;
|
||||
HttpWebRequest request;
|
||||
@ -380,6 +382,18 @@ namespace FlyDockTool
|
||||
}
|
||||
return strValue;
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
MessageBox.Show("网络请求失败: " + ex.Message + "\\n状态: " + ex.Status);
|
||||
return "";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("其他错误: " + ex.Message);
|
||||
return "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
2
mainForm.Designer.cs
generated
2
mainForm.Designer.cs
generated
@ -200,7 +200,7 @@
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "mainForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "福乐云软硬件数据对接工具V1.1(2025042501)";
|
||||
this.Text = "福乐云软硬件数据对接工具V1.1(2025050701)";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.mainForm_FormClosing);
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
|
||||
@ -24,7 +24,12 @@ namespace FlyDockTool
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
//兼容TLS
|
||||
System.Net.ServicePointManager.SecurityProtocol =
|
||||
System.Net.SecurityProtocolType.Ssl3 |
|
||||
System.Net.SecurityProtocolType.Tls |
|
||||
(System.Net.SecurityProtocolType)768 | // Tls11
|
||||
(System.Net.SecurityProtocolType)3072; // Tls12
|
||||
|
||||
string CurrentDevice = ConfigurationManager.AppSettings["CurrentDevice"];
|
||||
apiOptions.CurrentDevice = CurrentDevice;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user