zoukankan      html  css  js  c++  java
  • 请求被中止: 未能创建 SSL/TLS 安全通道”的原因及解决办法

    4 个解决办法,我用的第四个方法就解决了, 注册表手动添加的 重启后不管用,第四个方法 直接用程序改一下方便

    首先得保证服务器是否支持 tls1.2 去注册表里查或者百度怎么查,基本大多数都用的是1.2  

    1.   

    代码前加这个 

    ServicePointManager.Expect100Continue = true;
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
    ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;

    或者 ServicePointManager.SecurityProtocol = (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072;

    或者

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
    | SecurityProtocolType.Tls
    | (SecurityProtocolType)0x300 //Tls11
    | (SecurityProtocolType)0xC00; //Tls12

    2. 复制下面注册表代码导入到注册表。新建txt,将后缀txt改为reg(注册表项),导入

    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionInternet SettingsWinHttp]
    "DefaultSecureProtocols"=dword:00000800
    
    [HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionInternet SettingsWinHttp]
    "DefaultSecureProtocols"=dword:00000800
    
    [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Client]
    "DisabledByDefault"=dword:00000000
    "Enabled"=dword:00000001
    
    [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Server]
    "DisabledByDefault"=dword:00000000
    "Enabled"=dword:00000001
    
    [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Client]
    "DisabledByDefault"=dword:00000000
    "Enabled"=dword:00000001
    
    [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Server]
    "DisabledByDefault"=dword:00000000
    "Enabled"=dword:00000001

    3. 升级 到 fromwork4.6 版本

    4.

    https://www.nartac.com/Products/IISCrypto/Download

    去下载这个软件 打开软件后 都选上确定 重启就好了

  • 相关阅读:
    超详细的 Vagrant 上手指南
    简单聊聊 Ironic
    什么是裸金属
    使用 minikube 快速上手 Kubernetes | v1.7.3
    来看看你对Python变量理解到位了没有
    python HelloWorld 的 4 种姿势,你知道几种
    Windows 系统安装 Python 3.8 详解
    myeclipse2017下载安装与破解详细教程
    eclipse中tomcat的add and Remove找不到项目
    cmd中查看MySQL数据库表数据及结构
  • 原文地址:https://www.cnblogs.com/xuanlanbinfen/p/15118197.html
Copyright © 2011-2022 走看看