0

I'm trying to use requests to connect my python client to HP ALM so I can export Defects and Requirements. My problem is that when I try to connect to ALM I get this error.

requests.exceptions.SSLError: HTTPSConnectionPool(host='hpalm.xxx.com', port=443): Max retries exceeded with url: /qcbin/authentication-point/authenticate (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

my function is the following

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)

so far I've tried to follow this example:https://github.com/vkosuri/py-hpalm/blob/master/hpalm/hpalm.py but when I do the verify=False I get :

InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning)

and the following print of the log:

{'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'}

any ideas what I'm doing wrong? Thank you

h3lminth
  • 1
  • 1
  • 1
    https://stackoverflow.com/questions/27835619/urllib-and-ssl-certificate-verify-failed-error – Sergi Mar 05 '21 at 18:26

1 Answers1

0

There are alot of answers here on stack overflow about connecting to QC. I would recommended you go through,

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

These will help you understand the login process

Soham Ghosh
  • 169
  • 2
  • 3