VB. NET: The request was aborted: Could not create SSL/TLS secure channel

前端 未结 2 1646
庸人自扰
庸人自扰 2021-01-15 16:52

I have an application coded in VB.net that has this method of accessing Webservice, i have this error and after searching fixes i still have no luck.

Error: The requ

2条回答
  •  时光取名叫无心
    2021-01-15 17:54

    Obviously the URL you're calling requires TLS 1.1 or TLS 1.2.

    You can enable TLS 1.1 or TLS 1.2 by setting the security-protocol with ServicePointManager.SecurityProtocol:

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
    

    .NET 4.0 supports up to TLS 1.0 while .NET 4.5 or higher supports up to TLS 1.2
    For reference:

    • Default SecurityProtocol in .NET 4.5
    • Are there .NET implementation of TLS 1.2?

提交回复
热议问题