Delphi Tokyo 10.2 Windows 7上的TDSRestConnection DataSnap连接

问题描述 投票:0回答:1

在Windows 7上使用组件TDSRestConnection运行datasnap客户端应用程序时遇到以下错误:

“发送数据时出错:(12030)与服务器的连接异常中止。”

在Windows 10中它正常运行。

在我的测试中,我使用Windows 7 64位Service Pack 1进行所有更新。

码:

object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 328
  ClientWidth = 347
  FormFactor.Width = 320
  FormFactor.Height = 480
  FormFactor.Devices = [Desktop]
  DesignerMasterStyle = 0
  object Button1: TButton
    Position.X = 80.000000000000000000
    Position.Y = 96.000000000000000000
    Size.Width = 161.000000000000000000
    Size.Height = 105.000000000000000000
    Size.PlatformDefault = False
    TabOrder = 1
    Text = 'Button1'
    OnClick = Button1Click
  end
  object DSRestConnection1: TDSRestConnection
  Protocol = 'https'
    Host = 'ADRESSS'
    Port = 443
    UrlPath = '/mobisapi.dll'
    UserName = 'LOGIN'
    Password = 'PASSWORD'
    LoginPrompt = False
    ProxyPort = 8080
    Left = 64
    Top = 40
    UniqueId = '{D5182D08-67AE-4227-8583-4DB35F9940FD}'
  end
end

unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  DBXCommon, Datasnap.DSClientRest,
  Datasnap.DSClientMetadata, FMX.Types, FMX.Controls, FMX.Controls.Presentation,
  FMX.StdCtrls;

type
  TForm1 = class(TForm)
    DSRestConnection1: TDSRestConnection;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

procedure TForm1.Button1Click(Sender: TObject);
begin
  DSRestConnection1.TestConnection;
end;

end.
rest windows-7 connection datasnap delphi-10.2-tokyo
1个回答
0
投票

您好,因为在Windows 7和Windows 2008 R2上,TLS 1.1和TLS 1.2不是默认的安全协议。

这个微软页面有答案和运行和下载的简易修复。

用我的Delphi程序为我工作得很好。

https://support.microsoft.com/en-us/help/3140245/update-to-enable-tls-1-1-and-tls-1-2-as-a-default-secure-protocols-in

© www.soinside.com 2019 - 2024. All rights reserved.