SSL certificate CN does not match the hostname
While connecting to Azure VM, you may get the following connection fail error..
"Connecting to remote server site.cloudapp.net failed with the following error message :
The server certificate on the destination computer (site.cloudapp.net:5986) has the following errors: The SSL certificate contains a common name (CN) that does not match the hostname. For more information, see the about_Remote_Troubleshooting Help topic."
This error is a result of inappropriate SSL certificate being imported into your local SSL Store. One way to avoid this error is to switch off SSL check upon connecting to Azure. PowerShell command is show below for this purpose.
$sessionsOption= New-PSSessionOption -SkipCNCheck
New-PSSession 10.0.0.4 -Port 5000 -Credential domain\user-name -UseSSL -SessionOption $sessionOption