【问题标题】:Delphi Tokyo 10.2 TDSRestConnection DataSnap Connection on Windows 7Windows 7 上的 Delphi Tokyo 10.2 TDSRestConnection DataSnap 连接
【发布时间】:2018-04-10 18:05:49
【问题描述】:

在 windows 7 上运行带有组件 TDSRestConnection 的 datasnap 客户端应用程序时,我遇到了以下错误:

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

在 Windows 10 中它可以正常运行。

在我的测试中,我使用带有所有更新的 Windows 7 64 位服务包 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】:

    您好,您遇到了问题,因为在 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多