首页 > 其他分享 >DELPHI WIn7下使用 NetHttpClient 请求HTPPS 网站

DELPHI WIn7下使用 NetHttpClient 请求HTPPS 网站

时间:2023-11-22 11:44:57浏览次数:30  
标签:请求 网站 DELPHI WIn7 HTPPS NetHttpClient HttpClient

转载自:WIn7 下使用 NetHttpClient 请求HTPPS 网站 - EEEEEEEEEEEEEEEEEEE - 博客园 (cnblogs.com)

WIn7 下使用 NetHttpClient 请求HTPPS 网站

在WIN7 下使用 HttpClient 会报以下两种错 ;
1 Server Certificate Invalid or not present
2 Error sending data: (12175) 发生了安全错误.

3 System.Net.WebException: 请求被中止: 未能创建 SSL/TLS 安全通道。

经查询资料是因为WIn7 默认不支持这个协议
详细见:
https://support.microsoft.com/en-us/help/3140245/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-wi

解决方法:

指定 HttpClient.SecureProtocols  为TLS12

  HttpClient := TNetHTTPClient.Create(nil);
{$IFDEF MSWINDOWS} // 检查操作系统版本为 Windows 7
  if (Win32MajorVersion = 6) and (Win32MinorVersion = 1) then
    HttpClient.SecureProtocols := [THTTPSecureProtocol.TLS12];
{$ENDIF}

 

标签:请求,网站,DELPHI,WIn7,HTPPS,NetHttpClient,HttpClient
From: https://www.cnblogs.com/yoooos/p/17848620.html

相关文章

  • 联想杨(欺)天一体机降级win7
     1.关闭安全启动2.改AHCI3一般来说这种欺天电脑装32位的系统就好,一般来说不会出现卡logo卡驱动的情况,但事实上因为只支持win10,win76432安装会出现卡logo卡驱动的情况,这个时候就只能用sgi了sgi下载链接:https://pan.baidu.com/s/1M26wF8FygaLcOjXBq2PN6Q提取码:n44z跟hp的......
  • delphi ide优化设置(陆续整理)
    目前整理至delphi11版本即VER360 1、编译优化:   不勾选:Tool-Options-IDE-Compilingandrunning-ShowCompilerprogress 不勾选:Tool-Options-IDE-Compilingandrunning-ShowCommandline2、编辑器优化: Tool-Options-UserInterface-editor    Too......
  • delphi dev cxLookupComboBox 模糊搜索
    //不是过滤DATASET,适合用在下拉数据很多的情况。过滤的必须是下拉有添加的列procedurecxLookupComboBoxLikeSearchInitPopup(Sender:TObject);varFEdit:TcxLookupComboBoxabsoluteSender;i:integer;begin//ifFEdit.Properties.IncrementalSearchthen//FEdit......
  • 小甲鱼Delphi教程37课《读写修改记录型文件》源码
    说明:本程序用delphi10.4重写编写一、最后效果二、源码1unitUnit1;23interface45uses6Winapi.Windows,Winapi.Messages,System.SysUtils,System.Variants,System.Classes,Vcl.Graphics,7Vcl.Controls,Vcl.Forms,Vcl.Dialogs,Vcl.StdCtrls,V......
  • delphi:传递参数的几种方式(转载)
     原文地址:https://www.delphitop.com/html/chengxu/2732.html一、默认方式以值方式传递参数 procedure TForm1.ProcNormal(Value: string);   begin   OrigNum:=Value+' Me';   lblReturn.Caption:=OrigNum;//OrigNum为'Hello Me'   lblOrig.Caption:=Val......
  • delphi 路径操作函数
    路径操作函数System.SysUtils.AnsiCompareFileName根据当前语言环境比较文件名。在Windows下不区分大小写,在MACOS下区分大小写。在不使用多字节字符集(MBCS)的Windows区域设置下,AnsiCompareFileName与AnsiCompareText相同。在MACOS和Linux下,AnsiCompareFile......
  • Log4Delphi日志学习
    转载请注明出处:https://www.cnblogs.com/coder163/p/9309717.htmlhttps://log4delphi.sourceforge.net/tutorial.htmlLog4D下载:官网地址导入Delphi:Tool-->Options-->EnvironmentOptions--->DelphiOptions--Library-->Librarypath 三个目录使用载入配置文件菜单--->P......
  • Win7主板CMOS电池没电导致开机时间问题
    在shell:startup文件夹下面新建bat文件,内容如下:@echooffnetstopw32timenetstartw32timew32tm/config/manualpeerlist:"time.nist.gov"/syncfromflags:manual/reliable:yes/updatew32tm/resyncw32tm/resyncw32tm/config/manualpeerlist:"time.windows.......
  • Win7安装Python库Pandas
    Win7只能安装Python3.8及以下版本,3.9版本及以上不支持Win7系统。环境:Win764位操作系统下载安装Python3.8.564位软件版本。然后离线安装pandas库。(1)Python下载地址https://www.python.org/downloads/windows/(2)依赖库下载地址https://www.lfd.uci.edu/~gohlke/pythonlibs......
  • Delphi图像处理中ScanLine的使用
    一般我们在Delphi中进行图像处理时采用Pixels像素点赋值的方法,Delphi代码如下:varx,y:Integer;cColor:TColor;begin fory:=0toImage1.Height-1do   forx:=0toImage1.Width-1do     cColor:=Image1.Canvas.Pixels[i,j];end;但是这种方法有个缺点,处理速度很慢......