From the attached issue it looks like you have SSL handshake issue. In my opinion you need to import Trusted Certificate Authority (CA) the whole key chain to your environment. Please check this article: https://www.sharptree.io/blog/2023/2023-06-13-trust-ca
Original Message:
Sent: Sun October 13, 2024 03:58 PM
From: Pankaj Bhide
Subject: How to import requests (http requests) module in automation script
Thanks Bartosz. I already tried both and it did not work in our environment. It gave me error : psdi.util.MXSystemException: BMXAA1477E - The connection to the HTTP handler for the endpoint failed. Review the error and server log files to determine the cause of the issue, for example, incorrect properties in the DefaultHTTPExit.java handler class.
com.ibm.jsse2.util.j: PKIX path building failed: com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target
Not sure whether this error belongs to our environment or not.
Surprisingly if I copy/paste the same url in the browser, it shows me the contents of the file.
------------------------------
Pankaj Bhide
Original Message:
Sent: Sun October 13, 2024 02:32 PM
From: Bartosz Marchewka
Subject: How to import requests (http requests) module in automation script
Hi Pankaj,
Maybe these two articles will help you to solve your requirement:
------------------------------
Bartosz Marchewka
IBM Maximo Consultant
AFRY
Original Message:
Sent: Sun October 13, 2024 12:59 PM
From: Pankaj Bhide
Subject: How to import requests (http requests) module in automation script
Hello,
I want to perform HTTP Get using the APIKey to get the attached documents. For example: the following HTTP Get request renders the attached document from the browser:
https://<host>/maximo/api/os/LBL_DS_EVCHARGE/<restid>/doclinks/<doclinkid>?lean=1&apikey=<apikey>
I tried with the following:
handler = HTTPHandler()
map = HashMap()
map.put("URL", <the above url>)
map.put("HTTPMETHOD", "GET")
responseBytes = handler.invoke(map,None)
return responseBytes
However it gives error: the connection to the HTTP handler for the endpoint failed. Review the error and server log files to determine the cause of the issue, for example, incorrect properties in the DefaultHTTPExit.java handler class.
com.ibm.jsse2.util.j: PKIX path building failed: com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target
I am not sure whether the above code can work using the APIKey or not or it is supposed to work with username/password.
I therefore would like to use the python's native http "requests" library e.g. import requests. I tried import requests. However it gives error.
Any idea on how to use the "requests" module in the automation script?
Pankaj Bhide
------------------------------
Pankaj Bhide
------------------------------