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

Follow me on Facebook, Twitter or Telegram:
I learn with Educative: Educative I'm also a fan of SetApp for macOS: SetApp for macOS
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
31 Jan 2023

Homelab: MacBook Pro M2

17 Nov 2022

Video: awk delimiters

25 Oct 2022

macOS Ventura 13.0

Recent Tweets