We were in the process of migrating on premise Exchange to 2013 on Windows Server 2012 to office 365 and while installing the Hybrid Configuration Wizard we were getting the following error.
PowerShell failed to invoke ‘New-FederationTrust’: Unable to access the Federation Metadata document from the federation partner. Detailed information: “The underlying connection was closed: An unexpected error occurred on a receive
After some troubleshooting and collecting logs, we found out that the reason we were getting that is that a few years ago and to comply with PCI requirements, we disabled SSL and weaker TLS encryptions and enabled TLS 1.1 and 1.2 on the Exchange server. The Hybrid Configuration was invoking .NET that was trying to use those disabled protocols and therefore the Hybrid Configuration Wizard was failing. In Registry we told .NET to use the new TLS protocols.
Added the following Registry values