Share via

Running Deploy.ps1 when trying to install https://github.com/microsoft/mattercenter will raise this error "Message: The underlying connection was closed: An unexpected error occurred on a send."

john john 1,031 Reputation points
2022-06-18T00:53:26.55+00:00

We want to install MatterCenter from https://github.com/microsoft/mattercenter as per this documentation @ https://view.officeapps.live.com/op/view.aspx?src=http%3A%2F%2Fmicrosoft.github.io%2Fmattercenter%2Ftree%2Fmaster%2Fcloud%2Fdocs%2FMatter%2520Center%2520Build%2520and%2520Deployment%2520Guide.docx&wdOrigin=BROWSELINK , but when i execute Deploy.ps1 it will return this error

"Message: The underlying connection was closed: An unexpected error occurred on a send."`  
  
17/06/2022 19:51:02 - Step 1a: Create groups and adding users to it  
Message: The underlying connection was closed: An unexpected error occurred on a send.  
Stacktrace:    at System.Net.HttpWebRequest.GetResponse()  
   at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()  
   at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()  
   at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()  
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()  
   at Microsoft.Legal.MatterCenter.Common.ConfigureSharePointContext.ConfigureClientContext(String url, String userId, String password)  
   at Microsoft.Legal.MatterCenter.CreateGroups.Program.AddGroups(Dictionary`2 listval, List`1 groupData)  
Message: The underlying connection was closed: An unexpected error occurred on a send.  
Stacktrace:    at System.Net.HttpWebRequest.GetResponse()  
   at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()  
   at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()  
   at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()  
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()  
   at Microsoft.Legal.MatterCenter.Common.ConfigureSharePointContext.ConfigureClientContext(String url, String userId, String password)  
   at Microsoft.Legal.MatterCenter.CreateGroups.Program.DeleteGroups(Dictionary`2 listval, List`1 groupData)  
17/06/2022 19:51:04 - Creating group and adding users to it failed  
  
the logs will show this error:-  
  
Message: The underlying connection was closed: An unexpected error occurred on a send.  
Stacktrace:    at System.Net.HttpWebRequest.GetResponse()  
   at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()  
   at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()  
   at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()  
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()  
   at Microsoft.Legal.MatterCenter.Common.ConfigureSharePointContext.ConfigureClientContext(String url, String userId, String password)  
   at Microsoft.Legal.MatterCenter.CreateGroups.Program.DeleteGroups(Dictionary`2 listval, List`1 groupData) occurred at 17/06/2022 21:48:24  

any advice?

I also explicitly added TLS1.2 before calling the .exe as follow:-

Show-Message -Message "Step 1a: Create groups and adding users to it"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
& " $HelperPath\Microsoft.Legal.MatterCenter.CreateGroups.exe" "true" $Username $Password

but still i am getting the exact same error Message: The underlying connection was closed: An unexpected error occurred on a send... Any one has any idea how to fix this error? Thanks

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft 365 and Office | SharePoint Server | Development
0 comments No comments

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,496 Reputation points Microsoft External Staff
    2022-06-20T05:39:14.85+00:00

    Hi @john john ,
    If you are using .Net 4.0. TLS 1.2 is not supported, but if you have .NET 4.5 (or above) installed on the system then you still can opt in for TLS 1.2 even if your application framework doesn’t support it. The only problem is that SecurityProtocolType in .NET 4.0 doesn’t have an entry for TLS1.2, so we’d have to use a numerical representation of this enum value:

    [Net.ServicePointManager]::SecurityProtocol =  [Enum]::ToObject([Net.SecurityProtocolType], 3072)  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    Was this answer helpful?

    3 people found this answer helpful.

  2. 02191796 66 Reputation points
    2022-06-19T16:48:12.847+00:00

    thank you for this

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.