Skip to main content
Reporting API fails with unexpected error
Updated over 6 months ago

This article applies to inSync Cloud and inSync Gov Cloud

Problem description

Reporting API fails with one of the following unexpected error messages when using SSLv3 / TLS1.0.

Exception found Creating The Web Request: The underlying connection was closed: An unexpected error occurred on a send.

Or

Invoke-RestMethod: The underlying connection was closed: An unexpected error occurred on a send.

Cause

PowerShell and VB.net use TLS 1.0 and SSLv3 for Web requests. SSLv3 and TLS 1.0 were deprecated in a Cloud Push dated September 2, 2017. Hence the Reporting API script no longer works.

Resolution

For PowerShell, add the following lines in the script to enforce PowerShell to use TLS 1.2:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

For VB.net add the following lines in the script to enforce VB to use TLS 1.2:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

Did this answer your question?