【问题标题】:Python Client connecting to HP ALM 12.20连接到 HP ALM 12.20 的 Python 客户端
【发布时间】:2021-06-04 09:43:01
【问题描述】:

我正在尝试使用请求将我的 python 客户端连接到 HP ALM,以便导出缺陷和要求。 我的问题是当我尝试连接到 ALM 时出现此错误。

requests.exceptions.SSLError: HTTPSConnectionPool(host='hpalm.xxx.com', port=443): url: /qcbin/authentication-point/authenticate 超过最大重试次数(由 SSLError(SSLError("bad handshake : 错误([('SSL 例程', 'tls_process_server_certificate', '证书验证失败')])")))

我的功能如下

def connection():
   #HardCoded login to be deleted when tested and able to run with login verification
   user = userPass.user()
   pwd = userPass.passwd()
   #Not sure if needed, need to test
   encPwd = base64.standard_b64encode(pwd.encode('utf-8'))
   print(encPwd)
   userToEncode=user+':'+pwd
   print("user2Encode : {0}", userToEncode)
   #requests lib to ALM connection
   headers = {
       'cache-control': "no-cache",
       'Accept': "application/json",
       'Content-Type': "application/json"
   }
   authurl = almURL + "/authentication-point/authenticate"
   res = requests.post(authurl, auth=HTTPBasicAuth(user,encPwd),headers = headers)

到目前为止,我已尝试遵循此示例:https://github.com/vkosuri/py-hpalm/blob/master/hpalm/hpalm.py 但是当我执行 verify=False 时,我得到:

InsecureRequestWarning:正在发出未经验证的 HTTPS 请求。强烈建议添加证书验证。见:https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings 不安全请求警告)

以及以下打印的日志:

{'Date': 'Fri, 05 Mar 2021 17:36:51 GMT', 'X-Frame-Options': 'SAMEORIGIN', 'Content-Type': 'text/html; charset=ISO-8859-1', 'Cache-Control': 'must-revalidate,no-cache,no-store', 'Content-Length': '5937', 'Connection': 'close'}

任何想法我做错了什么? 谢谢

【问题讨论】:

标签: python restful-authentication alm


【解决方案1】:

这里有很多关于连接到 QC 的堆栈溢出的答案。 我会建议你通过,

  1. https://github.com/macroking/ALM-Integration/blob/master/ALM_Integration_Util.py
  2. HP ALM results attachment and status update using python

这些将帮助您了解登录过程

【讨论】:

    猜你喜欢
    • 2015-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多