Updating Java and DCM Certificates for ECB Exchange Rate Retrieval on IBM i
In our blog, we have previously discussed how to download exchange rates from the European Central Bank (ECB) using a simple SQL query with SYSTOOLS.HTTPGETCLOB, integrating it seamlessly into our ERP system. If you missed the article, here is the reference: How to Download ECB Exchange Rates with SQL.
Recently, however, the ECB has updated its services, making it necessary to update the CA certificates to continue receiving updated data. Depending on the method used for retrieving exchange rates, you will need to update either Java or the Digital Certificate Manager (DCM).
If your retrieval method relies on the SQL function SYSTOOLS.HTTPGETBLOB, you need to update the Java certificates to ensure a secure connection to ECB services. Here are the main steps:
You can obtain the CA certificate directly from the ECB website:
/mytempdir/QOpenSys/QIBM/ProdData/JavaVM/jdkXX/lib/security/cacerts).java -versionjava -version
java version "1.8.0_421"
Java(TM) SE Runtime Environment (build 8.0.8.30 - pap6480sr8fp30-20240801_01(SR8 FP30))
IBM J9 VM (build 2.9, JRE 1.8.0 OS/400 ppc64-64-Bit Compressed References 20240703_73934 (JIT enabled, AOT enabled)
OpenJ9 - 177ad469d4e
OMR - e74814c
IBM - 3c87141)
JCL - 20240731_02 based on Oracle jdk8u421-b09
/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit/jre/lib/securitykeytool -import -file /mytempdir/SSL.comTLSECCRootCA2022.crt -alias CertAuth -keystore /QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit/jre/lib/security/cacerts -storepass changeit -noprompt
keytool -import -file /mytempdir/EntrustOVTLSIssuingECCCA1.crt -alias CertAuth -keystore /QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit/jre/lib/security/cacerts -storepass changeit -noprompt
If you get a warning about certificate yet installed, please ingnore it.
To verify:
keytool -list -keystore /QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit/jre/lib/security/cacerts -storepass changeit
SELECT * FROM (
SELECT * FROM XMLTABLE (
XMLNAMESPACES (
DEFAULT 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref',
'http://www.gesmes.org/xml/2002-08-01' AS "gesmes"
),
'gesmes:Envelope/Cube/Cube/Cube' PASSING XMLPARSE ( DOCUMENT SYSTOOLS.HTTPGETBLOB(
'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml', ''
))
COLUMNS
currency CHAR(3) PATH '@currency',
rate REAL PATH '@rate',
time DATE PATH '../@time'
) AS ExchangeRates
) x
WHERE CURRENCY = 'USD'
ORDER BY TIME DESC;
For a few years now, HTTP_GET has been a more efficient alternative to HTTPGETCLOB, as it does not use Java and relies on DCM certificates for security.
http://myibmip:2006/dcm/mainframe/system*SYSTEM store.SELECT * FROM (
SELECT * FROM XMLTABLE (
XMLNAMESPACES (
DEFAULT 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref',
'http://www.gesmes.org/xml/2002-08-01' AS "gesmes"
),
'gesmes:Envelope/Cube/Cube/Cube' PASSING XMLPARSE ( DOCUMENT (
SELECT HTTP_GET(
'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml', ''
) FROM SYSIBM.SYSDUMMY1
))
COLUMNS
currency CHAR(3) PATH '@currency',
rate REAL PATH '@rate',
time DATE PATH '../@time'
) AS ExchangeRates
) x
WHERE CURRENCY = 'USD'
ORDER BY TIME DESC;
Updating the certificates is a crucial step to ensure the continued operation of ECB exchange rate retrieval. If you use SYSTOOLS.HTTPGETBLOB, update the Java certificates; if you use HTTP_GET, update the Digital Certificate Manager.
This simple update will allow you to continue integrating ECB exchange rates into your ERP system without interruptions.
If you have any questions or would like to share your experience, leave a comment below!
--- Roberto De Pedrini Faq400.com👉 Review: Bob Cozzi’s RPG IV to RPG Free Conversion – a useful VS Code extension for RPG modernization If…
Hello everyone, I’d like to highlight another excellent contribution by Massimo Duca, part of his ongoing IBM i & SQL…
Intrigued by some recent posts from Cristian Larsen on LinkedIn (New Release – Display File DDS Edit v 0.10.1), I…
Hello everyone, Today I’d like to draw your attention to a major new announcement from IBM: Project Bob — a…
I want to share with you a particularly useful article by Massimo Duca in the IBM i & SQL Tips…
Hello everyone, I’d like to highlight a very useful article by Marco Riva on Markonetools, where he clearly explains how…