Connect-VIServer не подключается из-за неверного сертификата, игнорирующего конфигурацию PowerCLI - PullRequest
2 голосов
/ 30 марта 2020

Как видно из названия, я пытаюсь войти на сервер VMWare vSphere с помощью PowerCLI. Несмотря на то, что я запустил Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -Scope AllUsers, когда я пытаюсь подключиться к серверу, вот что я получаю:

Connect-VIServer -Server "foobar.server" -User ... -Password ...
Connect-VIServer : 3/30/2020 4:16:46 PM Connect-VIServer                Error: Invalid server certificate. Use Set-PowerCLIConfiguration to set the value for the InvalidCertificateAction option to Prompt if you'd like to connect once or to add a permanent exception for this server.
Additional Information: Could not establish secure channel for SSL/TLS with authority 'foobar.server'.
At line:1 char:1
+ Connect-VIServer -Server "foobar.server" -User ... -Passw ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [Connect-VIServer], ViSecurityNegotiationException
    + FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_CertificateError,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer

Кажется, что конфигурация заняла:

Get-PowerCLIConfiguration

Scope    ProxyPolicy     DefaultVIServerMode InvalidCertificateAction  DisplayDeprecationWarnings WebOperationTimeout
                                                                                                  Seconds
-----    -----------     ------------------- ------------------------  -------------------------- -------------------
Session  UseSystemProxy  Multiple            Ignore                    True                       300
User                                         Ignore
AllUsers                                     Ignore

Почему я не могу подключиться к серверу?

1 Ответ

1 голос
/ 01 апреля 2020

, если вы используете старую версию vCenter (5.5), попробуйте это:

[System.Net.ServicePointManager]::SecurityProtocol =[System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...