question

djuii-79 avatar image
2 Likes"
djuii-79 asked

.NET4.0 SDK API call error: "The Request was aborted: Could not create Secure SSL/TLS channel".

Hi everyone. My program worked well for years and I did not change anything in the recent 1 year. Today, suddenly, it throw error when make api calls: "The Request was aborted: Could not create Secure SSL/TLS channel".

I have no idea how to resolve this. Please advise if you know how, thank you.

I use C# + ebay .net 4.0 SDK (Version 1131)

Thank you again for your help.

GOU

apissltsl
· 1
10 |600

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

moan-38 avatar image moan-38 commented ·
Were you able to find a solution?
0 Likes 0 ·
seef4666.mdizzaiswe avatar image
2 Likes"
seef4666.mdizzaiswe answered

If you want (and you are able) to change the .NET framework version of your main project in Visual Studio:
1. In your Solution Explorer, right-click your project and select Properties
2. In Properties, go to the Application option on the side menu
3. Locate the Target framework dropdown and select the framework version you need

If you have no access to the project solution or are not able to change the framework version and recompile the project, this link might help you:
https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls

Depending on your current framework version there are different ways to add TLS 1.2 support to your application.

Notice from ebay on the main page of the developers program: "Starting January 25th all API calls with TLS version <1.2 will fail. Please make sure your application is migrated to use TLS 1.2 or higher."

Yes, an email to all developers would have been more helpful :-)

· 1
10 |600

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

moan-38 avatar image moan-38 commented ·

I have done everything possible, and still doesn't work. I am going insane over this. I have a free SSL from cloudflare, is that not supported? I use the app on a subdomain.

0 Likes 0 ·
seef4666.mdizzaiswe avatar image
0 Likes"
seef4666.mdizzaiswe answered

Hi! One solution would be to use a higher target framework version in your C# project (4.7.2 or higher) to use TLS 1.2 (system default). Had the same issue and changing the target framework version from 4.0 to 4.8 fixed the problem without further changes to the code.

· 2
10 |600

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

hll_6289 avatar image hll_6289 commented ·
Thanks very much, you saved my day.
0 Likes 0 ·
djuii-79 avatar image djuii-79 commented ·
Thank you. I did follow your suggestion and the problem is resolved: without changes to the code:-) Thank you very much for your help.
0 Likes 0 ·
ubix avatar image
0 Likes"
ubix answered

We are seeing the same thing and we use the eBay C# SDK so do not have direct access to that setting. I will dig into the source if I have it and see if I can implement a fix, but this seems like something eBay has changed without notice.

10 |600

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

ubix avatar image
1 Like"
ubix answered

Just updated the eBay Service DLL to .NET 4.5.2 and implemented the TLS Protocol fix to no avail. Still getting the same error.

We also observe that different users have different experiences with the same code - older code that did not have the updates. This does not seem to be a problem with code, it seems to be a problem at eBay, and they do not seem to be aware of it or working on it based on a call to them by one of our users.

· 2
10 |600

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

cloud-racing avatar image cloud-racing commented ·
Thank you, ubix.

The problem is from eBay.

It is working now.

0 Likes 0 ·
djuii-79 avatar image djuii-79 commented ·

Hi, I followed seef4666.mdizzaiswe's suggestion and the problem is resolved. Before that I used a line System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | (SecurityProtocolType)3072 | (SecurityProtocolType)12288; to remove the problem but seems I still have to install .net framework 4.8 on the server. Hope this will help you.

0 Likes 0 ·
ubix avatar image
2 Likes"
ubix answered

Apparently the error is back and I verified that we are in fact setting TLS 1.2.

What do we need to do to enable API calls to work?

· 1
10 |600

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

djuii-79 avatar image djuii-79 commented ·

Try this code: System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | (SecurityProtocolType)3072 | (SecurityProtocolType)12288;

0 Likes 0 ·
broncos avatar image
1 Like"
broncos answered

We are getting the same issues, it worked last night but not from this morning, please someone from ebay confirm it is not your issue, code looks fine and nothing has changed from last night

10 |600

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

squareacircle avatar image
1 Like"
squareacircle answered

I had the same error. I updated the web app i have to .net 4.8 work. There was two line also that need updated in my web config for whatever reason they were still targeting .net 4.5

· 1
10 |600

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

moan-38 avatar image moan-38 commented ·
Can you please elaborate on this?
0 Likes 0 ·
moan-38 avatar image
0 Likes"
moan-38 answered

I have the exact same issue. My app was working for years and now suddenly this. I have the issue since March 30th. It first happened on March 24th and then auto-fixed itself in 1 hr, but since March 30th I am getting the same error.

Anyone got the solution to this yet?


10 |600

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

ubix avatar image
0 Likes"
ubix answered

We added TLS 1.2 to the setting under .NET 4.8 and that worked. So it turns out to be that you need both TLS 1.2 and .NET > 4.7 to make this work. The only failure we saw after that was on a Windows 7 machine that did not have the updates required to support TLS 1.2, and that is solvable by installing said updates.

10 |600

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

marferr4686 avatar image
0 Likes"
marferr4686 answered

Hi all, mi target framework is 4.8 and I'm using Ebay sdk (and from nuget I see there aren't updates)

I put System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | (SecurityProtocolType)3072 | (SecurityProtocolType)12288;

in my GetApiContext method

 static ApiContext GetApiContext()
        {

            System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | (SecurityProtocolType)3072 | (SecurityProtocolType)12288;

            //apiContext is a singleton,
            if (apiContext != null)
            {
                return apiContext;
            }

            else
            {
                apiContext = new ApiContext();

                //produzione
                apiContext.SoapApiServerUrl = "https://api.ebay.com/wsapi";
                ApiCredential apiCredential = new ApiCredential();
                apiCredential.eBayToken = EBAY_TOKEN;

                //Specify site: here we use US site
                apiContext.Site = eBay.Service.Core.Soap.SiteCodeType.Italy;

                return apiContext;
            } 

        } 

but nothing to do, I'm getting

eBay.Service.Core.Sdk.ApiException: 'Applicazione API "{0}" non valida.'

10 |600

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

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.