question

WebSpider-5357 avatar image
0 Votes"
WebSpider-5357 asked XingyuZhao-MSFT commented

The remote server returned an error: (409) Conflict.

Hi guys. I'm using visual studio 2010 and i have installed framework 4.8 to my windows 7.

I've targeted to Framework 4.5 in web.config

 <compilation debug="true" strict="false" explicit="true" targetFramework="4.5">

I got this error when i use the following code:
The request was aborted: Could not create SSL/TLS secure channel.

         Dim httpRequest As HttpWebRequest = DirectCast(WebRequest.Create(New Uri(EndpointUrl)), HttpWebRequest)
         httpRequest.Accept = "application/json"
         httpRequest.ContentType = "application/json"
         httpRequest.Method = "POST"

This error message returned when i added the following to my existing code:
The remote server returned an error: (409) Conflict.

     ServicePointManager.Expect100Continue = True
     ServicePointManager.SecurityProtocol = CType(3072, SecurityProtocolType)

     Dim httpRequest As HttpWebRequest = DirectCast(WebRequest.Create(New Uri(EndpointUrl)), HttpWebRequest)
     httpRequest.Accept = "application/json"
     httpRequest.ContentType = "application/json"
     httpRequest.Method = "POST"


I can use ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 which is not available in my VS2010.

Please advise. TQ


dotnet-runtime
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @WebSpider-5357 ,
Does the following code work for you?

 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls Or 
                                        SecurityProtocolType.Tls11 Or 
                                        SecurityProtocolType.Tls12 Or 
                                        SecurityProtocolType.Ssl3
0 Votes 0 ·

Hi @XingyuZhao-MSFT

Nope. I have tried both. TQ

0 Votes 0 ·

Hi @WebSpider-5357 ,
Take a look at the following suggestion.
Could not create SSL/TLS secure channel

 ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072


0 Votes 0 ·

0 Answers