The underlying connection was closed an unexpected error occurred on send



The underlying connection was closed an unexpected error occurred on send

Начиная с 13.08.2022 перестали скачиваться исправления (патчи) к конфигурациям с ошибкой:

«The underlying connection was closed: An unexpected error occurred on a send»

или то же самое на русском

«Базовое соединение закрыто: Непредвиденная ошибка при передаче.»

Временное решение

Как временное решение, можно использовать:

  • установку исправлений (патчей) из самой 1С
  • из обновлятора из локальной папки: ссылка

Причина и ход решения

15.08.2022 Предварительно, я полагаю, что у сервиса 1С изменились технические требования к версии протокола шифрования, который используется для соединения (исправления, в отличие от обновлений скачиваются через API соответствующего сервиса 1С). Сегодня (в понедельник) я приступил к решению проблемы — на днях будет новый билд, я напишу о его выходе в соц. сетях (vk, tg) и на этой страничке.

16.08.2022 Да, дело в изменившейся минимальной версии TLS, которую требует сервис 1С для скачивания исправлений. Сегодня, максимум завтра выйдет новая версия обновлятора, где часть кода, ответственная за скачивание исправлений будет вынесена в отдельный исполняемый файл, который для своего выполнения потребует также установленный на компьютере .Net Framework 4.5 (в большинстве современных ОС он уже входит в систему). Это ещё один довод в пользу запланированного на начало следующего года полного перехода на эту версию фреймворка (сейчас большая часть функционала обновлятора требует только .Net Framework 3.5).

16.08.2022 Вышла версия обновлятора от 16 августа с решением возникшей проблемы. Нажмите кнопку «Скачать новый обновлятор» внизу главного окна уже установленного обновлятора. Восстановлена возможность скачивания исправлений (патчей). Обратите внимание, что для скачивания исправлений (патчей) теперь необходим также установленный .Net Framework 4.5 или выше (он уже предустановлен в большинстве современных ОС). После обновления обновлятора на эту версию сразу проверьте возможность скачивания новых исправлений — если необходимой версии .Net Framework у вас на компьютере нет — обновлятор скажет об этом и даст соответствующую ссылку для установки. На начало 2023 года запланирован полный переход обновлятора на .Net Framework 4.5: ссылка.

23.08.2022 На старых ОС для корректной работы TLS должны быть установлены некоторые обновления, иначе возникает ошибка ‘Не удалось создать защищенный канал SSL/TLS’ или ‘Could not create SSL/TLS secure channel’: подробнее здесь.

С уважением, Владимир Милькин (преподаватель школы 1С программистов и разработчик обновлятора).

Подписывайтесь и получайте новые статьи и обработки на почту (не чаще 1 раза в неделю).

Вступайте в мою группу ВКонтакте, Одноклассниках, Facebook или Google+ — самые последние обработки, исправления ошибок в 1С, всё выкладываю там в первую очередь.

Как помочь сайту: расскажите (кнопки поделиться ниже) о нём своим друзьям и коллегам. Сделайте это один раз и вы внесете существенный вклад в развитие сайта. На сайте нет рекламы, но чем больше людей им пользуются, тем больше сил у меня для его поддержки.

Нажмите одну из кнопок, чтобы поделиться:

Источник

The underlying connection was closed an unexpected error occurred on send

Question

lately been having a problem sending and receiving response from thirdparty webservice. I have developed a windows service which runs for every 10 mins sending and receiving response from them. Their soap service uses https enabled with ssl/tls protocols. when the service is installed and running on my local machine. It runs with no problem at all. I have this bit of code before sending request to and also have enabled network tracing on the app

result from the log file that i have on my local machine is able to show that the validation is good.

System.Net Information: 0 : [21820] SecureChannel#50478517 — Remote certificate was verified as valid by the user.
System.Net Information: 0 : [21820] ProcessAuthentication(Protocol=Tls12, Cipher=Aes128 128 bit strength, Hash=Sha1 160 bit strength, Key Exchange=44550 384 bit strength).
System.Net.Sockets Verbose: 0 : [21820] Entering Socket#4476320::Send()

System.Net Information: 0 : [21820] Connection#55178356 — Created connection from 192.168.208.226:24506 to 41.183.202.16:443.
System.Net Information: 0 : [21820] TlsStream#11882963. ctor(host=»clients host address», #certs=0, checkCertificateRevocationList=False, sslProtocols=Tls11, Tls12)

But when i deploy the windows service to production server i get the below error

ystem.Net.Sockets Error: 0 : [10596] Socket#10359806::UpdateStatusAfterSocketError() — ConnectionReset
System.Net.Sockets Error: 0 : [10596] Exception in Socket#10359806::Receive — An existing connection was forcibly closed by the remote host.
System.Net.Sockets Verbose: 0 : [10596] Exiting Socket#10359806::Receive() -> Int32#0
System.Net.Sockets Verbose: 0 : [10596] Socket#10359806::Dispose()
System.Net Error: 0 : [10596] Exception in HttpWebRequest#44831880:: — The underlying connection was closed: An unexpected error occurred on a send..
System.Net Error: 0 : [10596] Exception in HttpWebRequest#44831880::GetResponse — The underlying connection was closed: An unexpected error occurred on a send..

i have also downloaded the ceritficates from digicert but still no change at all. What could be the fix for this help will be appreciated.

Источник

PowerShell – The underlying connection was closed: An unexpected error occurred on a send.

What should have been just another quick PowerShell script performing a WebRequest to get some data, turned into a debugging session when both the Invoke-RestMethod and Invoke-WebRequest PowerShell commands were returning; The underlying connection was closed: An unexpected error occurred on a send.

Invoke-RestMethod

Here is the PowerShell Invoke-RestMethod response that returns: The underlying connection was closed: An unexpected error occurred on a send.

Invoke-WebRequest

Here is the PowerShell Invoke-WebRequest response that returns: The underlying connection was closed: An unexpected error occurred on a send.

Due to PowerShell defaults, it’s not unusual to have issues with TLS. The ambiguous nature of this error did however make me jump to the conclusion that I probably just needed to enforce TLS 1.2. This can be done using this PowerShell one-liner:

However, in this situation that wasn’t the fix. Thinking it was still TLS related I checked out the SSL Certificate for the URI I was making my webrequests against. Looking at the certificate showed it was valid.

Solution

After a lot of searching I was able to work around the problem using scenarios from (here and here), however they weren’t ideal.

The resolution and solution I’m using to resolve the problem is to allow TLS, TLS 1.1 and TLS 1.2.

Insert the following line before invoking your PowerShell WebRequest using either Invoke-RestMethod or Invoke-WebRequest.

Summary

Hopefully this helps others experiencing this error, and allows me to quickly find it again next time I encounter this issue.

Also checkout my PowerShell Snippets Vol 1 and Vol 2 for other simple resolutions to ambiguous errors and tasks.

To resolve the PowerShell “underlying connection was closed” error, in your PowerShell script enable TLS:

Add the following line before your Invoke-RestMethod or Invoke-WebRequest call;

Источник

The underlying connection was closed an unexpected error occurred on send

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

Wondering if anyone could provide some insight to this. System written in ASP.Net VB hosted by Azure.

I have a few vendors who I submit XML files via WebRequest. The system has worked fine both in production (Azure) and on my development station until today.

I am now receiving an error, «The underlying connection was closed: An unexpected error occurred on a send.’ This error occurs when getting the request stream «request.GetRequestStream()» and occurs on the Azure website, and my development station. The only thing I can think of is that there was some security update that Microsoft did that affected my local station and Azure.

Snippet of code is as follows:

Any help would be appreciated!

Answers

After a bit of research, an adjustment to the Security Protocol fixed the issue, thanks to this link:

ServicePointManager.SecurityProtocol = DirectCast(3072, SecurityProtocolType)

to accommodate TLS1.2 in .Net Framework 4.0

  • Proposed as answer by Cherry Bu Microsoft contingent staff Thursday, February 15, 2018 6:11 AM
  • Marked as answer by Ron_13 Thursday, February 15, 2018 3:20 PM

After a bit of research, an adjustment to the Security Protocol fixed the issue, thanks to this link:

ServicePointManager.SecurityProtocol = DirectCast(3072, SecurityProtocolType)

to accommodate TLS1.2 in .Net Framework 4.0

  • Proposed as answer by Cherry Bu Microsoft contingent staff Thursday, February 15, 2018 6:11 AM
  • Marked as answer by Ron_13 Thursday, February 15, 2018 3:20 PM

All replies

Wondering if anyone could provide some insight to this. System written in ASP.Net VB hosted by Azure.

(not sure if this is the appropriate forum for this question)

I have a few vendors who I submit XML files via WebRequest. The system has worked fine both in production (Azure) and on my development station until today.

Источник

error: The underlying connection was closed: An unexpected error occurred on a send

I am experiencing the following error, when doing translations:
The underlying connection was closed: An unexpected error occurred on a send

This has happened suddenly without any change by my side of the script configuration.

I also can read in Resource Integrity: Not possible to determine the status of integrity of the resource Cognitive Services at the moment.

I am wondering if this relates to a known Microsoft Azure issue or if I should do any fix on my side.

Hi, thanks for reaching out. Are you using a global, regional, or multi-service resource to authenticate? If using a regional resource, can you please share the region?

We’re getting the same issue on calls to an O365 Sharepoint site.

I I have tried adding the below ones but still I’m getting the same error. I have tried adding at the beginning / Just the line before ExecuteQuery() but no luck. I’m invoking the SharePoint Online using the ClientContext. I’m using .NET framework 4.7.2. Let me know if I’m missing something?

3 answers

After MS support pointed us in the direction of TLS, adding the following line fixed the error for us:

Still don’t understand why after years of working fine today was the day it needed to be changed.

Edit: While the above definitely fixed the error, the line we ended up using was:
System.Net.ServicePointManager.SecurityProtocol |= System.Net.SecurityProtocolType.Tls12;

The resource to authenticate is Global.

and precisely when calling this method: System.Net.HttpWebRequest.GetResponse()

“Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host”

Stack Trace: in System.Net.HttpWebRequest.GetResponse()

Inner exception:
in System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
in System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)

Error code: 10054
SocketErrorCode: ConnectionReset <10054>System.Net.Sockets.SocketError

Thank you Stephen, I had to adapt this fix to .net framework, but it worked also!
Thank you very much for sharing.

I agree I can’t believe they suddenly have deprecated previous TLS versions, without any warning.

Источник

Читайте также:  Ошибка unhandled exception access violation c0000005
Оцените статью
toolgir.ru
Adblock
detector