Thanks Mark. I will work with our application service provider to do the needful about the certificate.
Original Message:
Sent: Mon October 14, 2024 05:05 AM
From: Mark Robbins
Subject: How to import requests (http requests) module in automation script
" com.ibm.jsse2.util.j: PKIX path building failed: com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target"
As Bartosz says this appears to be a SSL connection problem.
If you restart the JVM and perform the operatioin then I would expect to see a series of messages stating that the certiificate cannot be loaded. One of those messages should include full instructions about how to retrieve and install the certificate.
"Surprisingly if I copy/paste the same url in the browser, it shows me the contents of the file."
This isn't that surprising... the browser will have code in it to retrieve the certifcate and store it in the browser's cache.
------------------------------
Mark Robbins
Support Lead/Technical Design Authority / IBM Champion 2017 - 2023
Cohesive (previously Vetasi Limited)
https://www.linkedin.com/pulse/maximo-support-advice-from-non-ibm-engineer-article-mark-robbins/
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
------------------------------