zoukankan      html  css  js  c++  java
  • [解决]小程序要求的 TLS 版本必须大于等于 1.2

    今天微信小程序发现wx.request不好使了,调试报错: 小程序要求的 TLS 版本必须大于等于 1.2

    查官方文档

    解决方法

    在 PowerShell中运行以下内容, 然后重启服务器

    # Enables TLS 1.2 on windows Server 2008 R2 and Windows 7
    
    # These keys do not exist so they need to be created prior to setting values.
    md "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2"
    md "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Server"
    md "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Client"
    
    # Enable TLS 1.2 for client and server SCHANNEL communications
    new-itemproperty -path "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Server" -name "Enabled" -value 1 -PropertyType "DWord"
    new-itemproperty -path "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Server" -name "DisabledByDefault" -value 0 -PropertyType "DWord"
    new-itemproperty -path "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Client" -name "Enabled" -value 1 -PropertyType "DWord"
    new-itemproperty -path "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Client" -name "DisabledByDefault" -value 0 -PropertyType "DWord"
    
    # Disable SSL 2.0 (PCI Compliance)
    md "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsSSL 2.0Server"
    new-itemproperty -path "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsSSL 2.0Server" -name Enabled -value 0 -PropertyType "DWord"
    # Enables TLS 1.2 on Windows Server 2008 R2 and Windows 7 # These keys do not exist so they need to be created prior to setting values. md "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2" md "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Server" md "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Client" # Enable TLS 1.2 for client and server SCHANNEL communications new-itemproperty -path "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Server" -name "Enabled" -value 1 -PropertyType "DWord" new-itemproperty -path "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Server" -name "DisabledByDefault" -value 0 -PropertyType "DWord" new-itemproperty -path "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Client" -name "Enabled" -value 1 -PropertyType "DWord" new-itemproperty -path "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Client" -name "DisabledByDefault" -value 0 -PropertyType "DWord" # Disable SSL 2.0 (PCI Compliance) md "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsSSL 2.0Server" new-itemproperty -path "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsSSL 2.0Server" -name Enabled -value 0 -PropertyType "DWord"

    参考:http://henkuai.com/thread-16648-1-1.html

  • 相关阅读:
    单例模式
    eclipse部署web项目至本地的tomcat但在webapps中找不到
    使用 google gson 转换Timestamp为JSON字符串
    前端JS对后台传递的timestamp的转换
    2018第15周总结
    Tomcat的最大并发数
    平台对接的另外一种模式
    系统间数据交换的5种方式
    Spring Boot条件注解
    Spring Data JPA 和MyBatis比较
  • 原文地址:https://www.cnblogs.com/minamiko/p/6128455.html
Copyright © 2011-2022 走看看