【发布时间】:2016-05-15 01:03:18
【问题描述】:
我遵循了 Matt Wrock 非常有用的指南:Understanding and Troubleshooting WinRM connection and authentication, (http://www.hurryupandwait.io/blog/understanding-and-troubleshooting-winrm-connection-and-authentication-a-thrill-seekers-guide-to-adventure) 并且我能够在我的远程计算机上设置 SSL 连接,我使用以下方法进行了验证:
Test-WSMan -ComputerName "My DNS" -UseSSL
... 返回非错误消息。我也可以从 powershell 连接:
Enter-PSSession -ComputerName "My DNS" -Credential $cred -UseSSL
但是,当我运行以下 python 代码时:
import winrm
s = winrm.Session('My DNS', auth=('Remote Username', 'Remote Password'), transport='ssl')
r = s.run_cmd('ipconfig', ['/all'])
... 我收到以下错误代码: winrm.exceptions.WinRMTransportError: 500 WinRMTransport。 [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:590)
证书验证失败错误让我认为我错误地配置了 SSL 配置;但是,我似乎可以从 Powershell 进行连接。
谁能告诉我我做错了什么或如何使用 ssl 正确连接?
感谢您的宝贵时间
【问题讨论】: