首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >McAfee python脚本,SSL验证失败

McAfee python脚本,SSL验证失败
EN

Stack Overflow用户
提问于 2018-08-27 11:11:11
回答 1查看 172关注 0票数 0

因此,为了我的工作,我被要求学习McAfee的Python...无论如何,我找不到任何像样的文档,所以我想我应该在这里添加我的注释,看看是否有人可以改进我的解决方案。

无论如何,我得到了下面的错误:

代码语言:javascript
复制
    Error/reason: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)>

我的代码如下,删除了私人信息

代码语言:javascript
复制
    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()
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-08-27 11:13:11

所以我的解决方案是使用Monkey补丁(一个不明智的Monkey补丁...)在我的工作中使用下面的代码:

代码语言:javascript
复制
    import ssl

    ssl._create_default_https_context = ssl._create_unverified_context

如果您能找到更好的方法来实现连接,而不需要为我的ePO服务器提供有效的证书,请让我知道。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52032090

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档