Ignore SSL errors in VMware PowerCLI

VMware VMware Logo

I have a few weeks left on a couple of the dedicated servers I’m no longer using, so I figured it would be a good opportunity to refresh my VMware skills and perhaps learn something new with ESXi 6.5 (one of the best free hypervisors available, fully using hardware virtualization).

Turns out, you can install and use VMware PowerCLI on MacOS, pretty cool! As a pre-requisite, you need to install Windows PowerShell using Homebrew first. All the commands below are the PowerShell ones (you start it by typing pwsh).

SSL connection errors in VMware PowerCLI Because it’s a freshly installed ESXi instance with a self-signed SSL certificate, it will through a warning when connecting to the server using browser or using VMware PowerCLI:

PS /Users/greys> Connect-VIServer -Server 62.210.x.y

Specify Credential
Please specify server credential
User: root
Password for user root: *********

Connect-VIServer : 12/02/2019 23:43:52 Connect-VIServer The SSL connection could not be established, see inner exception.
At line:1 char:1
+ Connect-VIServer -Server 62.210.x.y
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Connect-VIServer], ViError
+ FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_SoapException,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer

This is because by default PowerCLI doesn’t have a defined approach to invalid SSL certificates. You can confirm it with the Get-PowerCLIConfiguration command:

Get-PowerCLIConfiguration Get-PowerCLIConfiguration

Ignore Invalid SSL Certificates in VMware PowerCLI

Let’s update tihe InvalidCertificateAction setting to “Ignore”:

Set-PowerCLIConfiguration -InvalidCertificateAction Set-PowerCLIConfiguration -InvalidCertificateAction

And now our connection should work just fine:

PS /Users/greys> Connect-VIServer -Server 62.210.x.y

Specify Credential
Please specify server credential
User: root
Password for user root: *********

Name Port User
---- ---- ----
62.210.x.y 443 root

PS /Users/greys>

That’s it! Will publish more as I learn, so stay tuned!

See Also

  • VMware Tools vs OpenVM Tools
  • Disk performance in VMware Workstation
  • HW Virtualization
  • VMware ESXi



Keep Learning with Me

Follow me on Facebook and Twitter or jump into Telegram chat!:
I'm using Brave browser
Give it a try, it's awesome: Brave Browser
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!
Recent Articles
28 May 2020

Raspberry Pi 4 8GB

19 May 2020

Grafana 7.0 Released

13 May 2020

OpenIndiana 2020.04 Released

Recent Tweets