Skip to main content
Participating Frequently
Jan 25, 2023 6:49 PM UTC

cURL on z/OS

Hi,

The version of cURL in my z/OS system is: curl 7.52.1 (i370-ibm-openedition)
curl-config --ca returns: /u/mvsbuild/py361z/python36/etc/ssl/cacert.pem 

But I can't find that directory. Instead I found cacert.pem is under /u/python/python36/etc/ssl. So I created that directory and copy cacert.pem there.

I tried 3 different ways:
1) When I issue the command without specifying --cacert and --capath, I got error
curl: (60) SSL certificate problem: self signed certificate in certificate chain

2) When I issue the command specifying --cacert and --capath, I got error
curl: (77) error setting certificate verify locations:
CAfile: cacert.pem
CApath: /u/mvsbuild/py361z/python36/etc/ssl

3) When I copy the cacert.pem file to the current directory, it works.

Questions:
1. Is there something wrong with the build process that made the cacert.pem stored in a wrong location?

2. After manually copied the cacert.pem to the desired location, why can't it be used, even specifying the location explicitly?

3. Is it a requirement that cacert.pem has to be in the current directory and it needs to be specified explicitly?

4. Is there a way to use a RACF keyring specified in the configured AT-TLS policy file that contains the CA certs instead of using the pem file?

------------------------------
Wai Choi
MS
IBM
POUGHKEEPSIE NY US
------------------------------

    17 replies

    Wai ChoiAuthor
    Participating Frequently
    Feb 6, 2023 1:59 PM UTC
    My point is root CA cert is self-signed. Why does it appear as an error. The chain validation would end up to the root. This message is misleading if it complains about the root.

    ------------------------------
    Wai Choi
    MS
    IBM / Tivoli Software
    POUGHKEEPSIE NY US
    ------------------------------
    Another question on z/OS curl: how to specify the data as an input file? From Windows, I can specify --data @filename, but on z/OS, it is treated as the content, not the file that contains the content.​ I have tried --data-raw @filename, doesn't work neither.
    ​

    ------------------------------
    Wai Choi
    MS
    IBM / Tivoli Software
    POUGHKEEPSIE NY US
    ------------------------------
    Jorn Thyssen
    Rocketeer
    Feb 6, 2023 2:17 PM UTC
    My point is root CA cert is self-signed. Why does it appear as an error. The chain validation would end up to the root. This message is misleading if it complains about the root.

    ------------------------------
    Wai Choi
    MS
    IBM / Tivoli Software
    POUGHKEEPSIE NY US
    ------------------------------
    Maybe I misunderstood: do you get the self-signed message when you pass the correct or incorrect root ca?
    If the latter, then that is expected, as the reply from your web server now contains a self-signed certificate in the chain (namely the root ca).

    --data works fine for me:

    curl --user abc:def -X PUT --data @genreq "http://rs01:11443/zosmf/restfiles/ds/'TS5941.WORK.JCL(TEST1)'"


    ------------------------------
    Jorn Thyssen
    Solutions Advisor
    Rocket Internal - All Brands
    Waltham MA US
    ------------------------------
    Wai ChoiAuthor
    Participating Frequently
    Feb 6, 2023 8:07 PM UTC
    Maybe I misunderstood: do you get the self-signed message when you pass the correct or incorrect root ca?
    If the latter, then that is expected, as the reply from your web server now contains a self-signed certificate in the chain (namely the root ca).

    --data works fine for me:

    curl --user abc:def -X PUT --data @genreq "http://rs01:11443/zosmf/restfiles/ds/'TS5941.WORK.JCL(TEST1)'"


    ------------------------------
    Jorn Thyssen
    Solutions Advisor
    Rocket Internal - All Brands
    Waltham MA US
    ------------------------------
    Sorry for the false alarm. z/OS curl does accept --data @filename. It is the application rejecting it, not curl.
    ​
    When I pass an incorrect CA, I got:
    TLSv1.2 (OUT), TLS alert, unknown CA (560): <==this is expected
    ...
    curl: (60) SSL certificate problem: self signed certificate in certificate chain <==this is misleading. A complete cert chain must contain a root cert, which is self-signed.

    ------------------------------
    Wai Choi
    MS
    IBM / Tivoli Software
    POUGHKEEPSIE NY US
    ------------------------------
    Jorn Thyssen
    Rocketeer
    Feb 7, 2023 5:33 AM UTC
    Sorry for the false alarm. z/OS curl does accept --data @filename. It is the application rejecting it, not curl.
    ​
    When I pass an incorrect CA, I got:
    TLSv1.2 (OUT), TLS alert, unknown CA (560): <==this is expected
    ...
    curl: (60) SSL certificate problem: self signed certificate in certificate chain <==this is misleading. A complete cert chain must contain a root cert, which is self-signed.

    ------------------------------
    Wai Choi
    MS
    IBM / Tivoli Software
    POUGHKEEPSIE NY US
    ------------------------------
    I think that would be a question for the curl community. I get the same behavior on my windows workstation and USS.

    ------------------------------
    Jorn Thyssen
    Solutions Advisor
    Rocket Internal - All Brands
    Waltham MA US
    ------------------------------
    sandeep235036
    New Participant
    Feb 11, 2026 12:25 PM UTC
    Hi Sergey,

    Thanks for the response. I managed to find a newer version of curl from another system.
    curl 7.83.1 (i370-ibm-openedition) libcurl/7.83.1 OpenSSL/1.1.1s
    Release-Date: 2022-05-11

    Seems CURL_CA_BUNDLE needs to include the CA file name together with the full path, like /tmp/cafile/cacert.pem, not just /tmp/cafile so that --cacert can be omitted from the command.

    And do you have an answer to my question 4:
    4. Is there a way to use a RACF keyring specified in the configured AT-TLS policy file that contains the CA certs instead of using the pem file?

    ------------------------------
    Wai Choi
    MS
    IBM / Tivoli Software
    POUGHKEEPSIE NY US
    ------------------------------

    Hi Wai,
    Keyring support is not available at the moment, but it is on the table.

    ------------------------------
    Tatiana Balaburkina
    Engineering Manager
    Rocket Internal - All Brands
    ------------------------------

    Hi Sergey,

    We would like to have libcurl 7.83.1 installed in our environment as well.
    Could you please provide this version ?

    sandeep235036
    New Participant
    Feb 12, 2026 9:26 AM UTC
    Hi Sergey,

    Thanks for the response. I managed to find a newer version of curl from another system.
    curl 7.83.1 (i370-ibm-openedition) libcurl/7.83.1 OpenSSL/1.1.1s
    Release-Date: 2022-05-11

    Seems CURL_CA_BUNDLE needs to include the CA file name together with the full path, like /tmp/cafile/cacert.pem, not just /tmp/cafile so that --cacert can be omitted from the command.

    And do you have an answer to my question 4:
    4. Is there a way to use a RACF keyring specified in the configured AT-TLS policy file that contains the CA certs instead of using the pem file?

    ------------------------------
    Wai Choi
    MS
    IBM / Tivoli Software
    POUGHKEEPSIE NY US
    ------------------------------

    Hi Wai,
    Keyring support is not available at the moment, but it is on the table.

    ------------------------------
    Tatiana Balaburkina
    Engineering Manager
    Rocket Internal - All Brands
    ------------------------------

    Hi Sergey,

    We would like to have libcurl 7.83.1 installed in our environment as well.
    Could you please provide this version ?

    Thanks!

    Sandeep

    HCL

    Sergey Rezepin
    Rocketeer
    Feb 12, 2026 2:47 PM UTC

    Hi Sandeep,

    As far as I remember, we didn’t release 7.83.1 version of cURL.
    The available cURL versions can be found here:
    https://anaconda.org/channels/zoss-appdev/packages/curl/files

    You can install it by using z/OS Miniconda, but you need to install the z/OS Miniconda at first.
    The Miniconda installation guide and all other manuals can be found in Rocket Open AppDev for Z User Guide V2.0:
    https://docs.rocketsoftware.com/bundle/openappdev_ug_20/page/nqk1645819314979.html

    Thanks,
    Sergei