Automation

 View Only
  • 1.  The SSL connection could not be established, see inner exception

    Posted Apr 11, 2022 01:21 PM

    I have the following code :

    $vcenterServer = "192.168.119.22"
    $vcenterUsername = "user"
    $vcenterPassword = "passwd"

    $dataCeneterName = "dc"
    $dsName = "datastore1"
    $esxName = "192.168.119.1"

     

    Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false #discarding SSL connection
    $vcenterInstance = Connect-VIServer -Server $vcenterServer -User $vcenterUsername -Password $vcenterPassword

     

    But I get the following errror:

    $vcenterInstance = Connect-VIServer -Server $vcenterServer -User $vcenterUsername -Password $vcenterPassword
    Connect-VIServer: 4/11/2022 5:50:57 PM Connect-VIServer The SSL connection could not be established, see inner exception.

    How can I solve it?

    By the way, my pwsh is 7.2.1



  • 2.  RE: The SSL connection could not be established, see inner exception

    Posted Apr 11, 2022 01:38 PM

    Ciao 

    Can you check InvalidCertificateAction setting with the Get-PowerCLIConfiguration command?



  • 3.  RE: The SSL connection could not be established, see inner exception

    Posted Apr 11, 2022 08:51 PM

    moderator note:

    in case you missed the "notification".

    Please post your new PowerCLI questions in this group (click the link below and THEN post)
    https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/bd-p/2805

    I have moved many of your questions here as this is the place that people will see your PowerCLI questions and can help you. You post again and again in the wrong spot.

    I'm not your "moderator move post service" and yes I understand the forum can be confusing. Next time you post in the wrong spot.. I will just leave it sitting there.

    --
    Wil



  • 4.  RE: The SSL connection could not be established, see inner exception



  • 5.  RE: The SSL connection could not be established, see inner exception

    Posted Apr 12, 2022 10:22 AM

    Solved, I downgrade my powercli to 7.0.