因此,为了我的工作,我被要求学习McAfee的Python...无论如何,我找不到任何像样的文档,所以我想我应该在这里添加我的注释,看看是否有人可以改进我的解决方案。
无论如何,我得到了下面的错误:
Error/reason: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)>我的代码如下,删除了私人信息
import mcafee
mc = mcafee.client("172.16.153.194", "8443","admin","password")
#code specific to this task
input = "mytag" #
systems = mc.system.find(input)#Search text can be IP address, MAC address, user name, agent GUID or tag
#The above uses the System Tree for searching
for system in systems:
#The below file contains EPOComputerProperties
#the file is in the for loop to all each device to produce results
for each property
file = open('C:/.../.../.../myquery.txt')
for i in file:
id = system[i.rstrip('\n')]
print id
print ""
file.close()发布于 2018-08-27 11:13:11
所以我的解决方案是使用Monkey补丁(一个不明智的Monkey补丁...)在我的工作中使用下面的代码:
import ssl
ssl._create_default_https_context = ssl._create_unverified_context如果您能找到更好的方法来实现连接,而不需要为我的ePO服务器提供有效的证书,请让我知道。
https://stackoverflow.com/questions/52032090
复制相似问题