• Could not establish trust relationship for the SSL/TLS secure channel


    The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

     意思是:请求的接口不支持Https,改为http试试

    如何配置服务支持https?根据域名解析到kong网关,kong网关配置证书,支持https

    postman用https调用,好使了,但是程序使用https调用还是不好使,报下面的错:

    System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) 

    经常排查,kong网关只支持TLSv1.2,加上TLSv1和TLSv1.1,reload后终于好使了,或者在程序中加

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;

    参考:https://blog.csdn.net/jl1134069094/article/details/82496761

    https://www.cnblogs.com/Jack-Blog/p/13170728.html

  • 相关阅读:
    超市账单管理系统设计思路
    Hibernate之Query.uniqueResult()结果为数值的注意事项
    Hibernate之Query.uniqueResult()结果为数值的注意事项
    Struts2加载自定义库注意事项
    135编辑器使用方法
    SQLite – ORDER 子句
    Readings
    自己常用的导航工具
    Spring中的事件处理
    iOS-Runtime
  • 原文地址:https://www.cnblogs.com/liuqiyun/p/16527574.html
Copyright © 2020-2023  润新知