How to resolve “Could not create SSL/TLS secure channel” exception for SharePoint Online when using PnP PowerShell

This post shows you, how to resolve the “Could not create SSL/TLS secure channel” error, when we tried to connect using PnP PowerShell

When I tried to connect SharePoint Online through PnP PowerShell by using below command.

PS: > $cred = Get-Credential
PS: > Connect-PnPOnline –Url https://<tenant>.sharpeoint.com –Credential $cred

I have received the below error message.

Connect-PnPOnline : The request was aborted: cluld not create SLL/TLS secure channel.

I have checked the code. Oh… and I was entered the url with typo error to connect the site.

SSL/TLS Connection Issue
SSL/TLS Connection Issue

So, I have corrected the url and tried to connect the site. It works fine.

PS: > $cred = Get-Credential
PS: > Connect-PnPOnline –Url https://<tenant>.sharepoint.com –Credential $cred

Root cause:

This issue will raise, when we provide the wrong URL.

Solution:

Please check the URL once again, before running the code.

SSL/TLS Connection Success
SSL/TLS Connection Success
Shantha Kumar
Shantha Kumar
Articles: 278

24,849 Comments

  1. In my scenario, the SP environment was requiring TLS 1.2 . PowerShell defaults to TLS 1.0 . I ran the following to make PowerShell run TLS 1.2 and fix my issue.
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Comments are closed.