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 -version
java -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/security
keytool -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.comIf you work with IBM i, I recommend reading this insightful article by Giancarlo Lui: IBM i System Management: Simpler…
In his recent article "RPG Free and option *convert" , Aldo Succi explores the *CONVERT option in the RPG language,…
We are pleased to receive and share this "tip & trick" from Patrick Rizzi, which introduces a technique that allows…
I take inspiration from a response by Michael Mayer on the Midrange.com mailing lists to someone who asked how to…
Businesses are increasingly seeking tools to enhance efficiency, collaboration, and resource management. Enterprise Resource Planning (ERP) systems provide a comprehensive…
Early April saw the release of the "Spring Version" of ACS Access Client Solution, version 1.1.9.5 Interesting new features especially…