question

AhmedSalman-3172 avatar image
0 Votes"
AhmedSalman-3172 asked WattsJonathan-0590 commented

New-ExoPSSession The SSL connection cannot be established

Hi,

I’m getting the below error when I try to connect exchange online using PowerShell from my Server 2012 R2

New-ExoPSSession : Connecting to remote server outlook.office365.com failed with the following error message : The
server certificate on the destination computer (outlook.office365.com:443) has the following errors:
Encountered an internal error in the SSL library. For more information, see the about_Remote_Troubleshooting Help
topic.
At C:\Program
Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\2.0.5\netFramework\ExchangeOnlineManagement.psm1:475 char:30

windows-server-powershelloffice-outlook-itprooffice-exchange-online-itprowindows-server-2012
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AhmedSalman-3172 ,

Welcome to our forum!

Looks like your issue is related to Exchange online, please kindly understand that the Outlook tag here we mainly focus on general issues about Outlook desktop client. In order to better solve your problem, we will add "office-exchange-online-itpro" tag.

Thanks for your understanding and hope your issue would be resolved soon.

0 Votes 0 ·

@AhmedSalman-3172
I am writing here to confirm with you any update about this thread now.
If the suggestion below helps, please be free to accept it as an answer for helping more people.

0 Votes 0 ·

Hi @AhmedSalman-3172

Did you get a fix for this?

I am having exactly the same issue from a single server, while alternate servers are succeeding. In theory, they are all configured identically, in terms of network configuration, etc. and are all running 2.0.5 of the module.


0 Votes 0 ·
michev avatar image
0 Votes"
michev answered michev commented

Make sure you enable TLS1.2 first:

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

Other than that, make sure you have the latest updates, at minimum the Trusted root CA ones.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the reply yes I verified and we have enabled TLS1.2 and the server got the latest update installed.
Still same error

0 Votes 0 ·
michev avatar image michev AhmedSalman-3172 ·

Just tested on a 2012R2 box, works fine after enabling TLS1.2. Make sure it's enabled in registry too, under

 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client
0 Votes 0 ·
KyleXu-MSFT avatar image
0 Votes"
KyleXu-MSFT answered

@AhmedSalman-3172

Whether there exists firewall in your organization, if so, I would suggest you try to disable it temporarily to check whether this phenomenon is caused by it. You need to make sure Office 365 URLs and IP address ranges could access from your client successfully.

I also suggest you have a check whether there exists proxy setting on your client. If there is, try to remove it and connect to Exchange online again.


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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.