question

greenwich-market-trader avatar image
0 Likes"
greenwich-market-trader asked ·

Cannot connect to API after TLS 1.2 Upgrade?

Since yesterday 15th September I have been getting the message "The underlying connection was closed: An unexpected error occurred on a send." in VB from Visual Studio 2008 I think it is to do with the fact I am on XP and have .Net 4.0 which doesn't support TSL1.2 however the message says that eBay will also continue to support TLS 1.0 and 1.1 until at least June 2017 But this doesn't seem to be the case so I am putting the question out in case there a work around. My code is: Dim req As HttpWebRequest = WebRequest.Create(SandboxURL) req.KeepAlive = False Dim resp As HttpWebResponse = Nothing 'Add the request headers req.Headers.Add("X-EBAY-API-COMPATIBILITY-LEVEL", "981") req.Headers.Add("X-EBAY-API-SITEID", "3") req.Headers.Add("X-EBAY-API-CALL-NAME", Target) req.Headers.Add("X-EBAY-API-DEV-NAME", "**********************************") req.Headers.Add("X-EBAY-API-APP-NAME", "**********************************") req.Headers.Add("X-EBAY-API-CERT-NAME", "**********************************") 'set the method to POST req.Method = "POST" 'Convert the string to a byte array Dim xmlSource As String = Payload Dim xmlDoc As New XmlDocument xmlDoc.LoadXml(xmlSource) xmlDoc.Save("D:\My Documents\eBayFeeds\LeaveFeedback.xml") Dim postDataBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(Payload) Dim len As Integer = postDataBytes.Length req.ContentLength = len req.ContentType = "text/xml" 'Post the request to eBay Try Dim requestStream As Stream = req.GetRequestStream() requestStream.Write(postDataBytes, 0, len) requestStream.Close() Catch e As WebException Debug.Print(e.Message) End Try which gives the Message "The underlying connection was closed: An unexpected error occurred on a send."
tls1.2
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.