如何解决尝试使用nexuscli使用python连接到nexus
我正在尝试连接服务器:
nexus_config = nexuscli.nexus_config.NexusConfig(username=NEXUS_USER,password=NEXUS_PASSWORD,url=NEXUS_URL,x509_verify=True)
nexus_client = nexuscli.nexus_client.NexusClient(config=nexus_config)
print(nexus_client.repositories.list)
但是,我得到了错误:
nexuscli.exception.NexusClientConnectionError: HTTPSConnectionPool(host='my_site.net',port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1,'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1091)')))
https://nexus3-cli.readthedocs.io/en/latest/nexuscli.html#module-nexuscli.nexus_config
使用带有请求库的API endpoing检查URL并将设置validate=False
设置为警告并可以正常工作。
因此,我将代码更改为:x509_verify=True
希望与请求相同的结果是我会收到警告,但我得到了警告。
有什么我想念的吗?还是库中有错误? 谢谢大家。
nexuscli.exception.NexusClientAPIError: <exception str() failed>
解决方法
您遇到了例外:NexusClientAPIError
。根据{{3}}:
except nexuscli.exception.NexusClientAPIError基础:异常
Nexus服务的意外响应。
我认为您的代码很好,x.509
证书的问题已解决,问题可能出在服务器端。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。