UPS error - connection closed on send

Posted By SAbow Mon 22 Jan 2018
Add to Favorites0
Author Message
SAbow
 Posted Mon 22 Jan 2018
Supreme Being

Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)

Group: Forum Members
Last Active: Tue 2 Feb 2021
Posts: 77, Visits: 334
Hi,

Just recently began getting this error in a couple of my Kartris sites... (these are hosted on different servers that all have TLS 1.2 already installed on them)
On front of site, says "no shipping available to your destination", but in the log this is the error I see:
"UPS - Error: The underlying connection was closed: An unexpected error occurred on a send."

the config url was recently updated to "https://onlinetools.ups.com/ups.app/xml/Rate" due to security updates on ups's api calls. And worked fine for a couple of weeks... now this...
Do you think the code for this call is no longer secure enough (TLS 1.2, etc)?

Please look into this issue ASAP.

Thanks,
Mon 22 Jan 2018 by SAbow
mparker Marked As Answer
 Posted Tue 23 Jan 2018
Supreme Being

Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)

Group: Forum Members
Last Active: Thu 25 Jan 2018
Posts: 6, Visits: 19
Try putting this within the Application_Start() sub of the Global.asax. This will force Kartris to use TLS 1.2.

Try
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12
Catch
End Try
SAbow
 Posted Wed 24 Jan 2018
Supreme Being

Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)

Group: Forum Members
Last Active: Tue 2 Feb 2021
Posts: 77, Visits: 334
We added the code that you sent, but it's still throwing the same error.Do we need to change the version of .NET (right now it's using version 4.0.30319)?
Do you have a working site that ships via UPS that we can look at?
mparker
 Posted Thu 25 Jan 2018
Supreme Being

Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)Supreme Being - (2,889 reputation)

Group: Forum Members
Last Active: Thu 25 Jan 2018
Posts: 6, Visits: 19
Hey - We do have a client running Kartris and is successfully using UPS (I can PM you). We were having issues prior to the code change posted above. That's the only change that I made. Here's a blog post about enabling TLS 1.2: https://blogs.perficient.com/microsoft/2016/04/tsl-1-2-and-net-support/. It looks like the newest version of Kartris also has this change now.
We're running .NET v4.0.30319.18051 on Windows Server 2012. You may need to Google if you need to do anything on a server level. Not sure if one of our sys admins did that prior.


Maybe someone from Kartris could shed some light on this?
Thu 25 Jan 2018 by mparker
SAbow
 Posted Thu 25 Jan 2018
Supreme Being

Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)

Group: Forum Members
Last Active: Tue 2 Feb 2021
Posts: 77, Visits: 334
After much digging around we finally found a setting that needed to be turned on - now it works with that code that you sent! Thank you so much!!!
Paul
 Posted Mon 29 Jan 2018
große Käse

große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)

Group: Administrators
Last Active: Fri 15 Sep 2023
Posts: 806, Visits: 2,737
I recall that TLS 1.2 support requires ASP.NET 4.5 or above, which the perficient link above confirms too. I wasn't aware that 4.6 defaults to tls 1.2, but that's good news as it should take care of most installations of older Kartris assuming they're putting on ASP.NET updates.

The environment version numbers for the ASP.NET installations are a little misleading. For example v4.0.30319.42000 looks like it should be ASP.NET 4.0 but it is 4.6.

Microsoft recommends checking the registry to see the .NET version installed:

https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed

It's a bit of a messy approach. You have to look up DWORD values then look them up in a table to find what .NET version they correspond to.

Microsoft really should have incorporated a simpler way within the app code itself to find what version of .NET it's actually running on, especially as the 4.x branch is very stable now, and code written for 4.5 could be running on 4.5.1, 4.5.2, 4.6, 4.6.1, 4.7, etc. all of which have slight differences and new features which might need to be coded around.


--
If my post solves your issue, can you 'Mark as Answer' so it's easier for other users to find in future.

If you would like to be informed of new features, new releases, developments and occasional special bonuses, please sign up to our mailing list: http://bit.ly/19sKMZb
Paul
 Posted Fri 9 Feb 2018
große Käse

große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)große Käse - (450,868 reputation)

Group: Administrators
Last Active: Fri 15 Sep 2023
Posts: 806, Visits: 2,737
When you say you found a setting, can you clarify where this was? I have another client reporting issues, and the ASP.NET 4.6 setting on its own doesn't seem to address it. Was the setting a kartris one, or somewhere on Windows?

--
If my post solves your issue, can you 'Mark as Answer' so it's easier for other users to find in future.

If you would like to be informed of new features, new releases, developments and occasional special bonuses, please sign up to our mailing list: http://bit.ly/19sKMZb
SAbow
 Posted Mon 12 Feb 2018
Supreme Being

Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)Supreme Being - (39,093 reputation)

Group: Forum Members
Last Active: Tue 2 Feb 2021
Posts: 77, Visits: 334
The setting that we needed to change was a bit embarrassing actually - I didn't realize that someone had made UPS inactive when this error started coming up, so after

(1) Adding this code to the Application_Start function of global.asax
Try
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12
Catch
End Try

(2) In the backend (Configuration > Payment and Shipping Gateways): changing the UPS URL to https://onlinetools.ups.com/ups.app/xml/Rate



all I needed to do was turn UPS back on.

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top