Rocket Open-Source Languages and Tools for z/OS

 View Only

 Queries about using curl in zos

Tony Lam's profile image
Tony Lam posted 06-09-2022 08:54

Hello, I'd like to ask some questions about using curl in zos,
to be more specific I'm exploring how to upload/download things from zos to Nexus.

The command like this :
curl -v -u id:pw -X "POST" "nexusurl" .......skipped the remaining input for nexus

My questions are :
1. With above command, it would be showed with SSL error as the Nexus server is SSL only.
If I insert this --cacert into the command, the connection would be good :
--cacert /path/cert.pem  where the cert.pem is having the required SSL cert

Is there anyway to setup the curl with default cert path so that we don't need to specify the --cacert location in the command?

2. Alternatively, Is there any way to refer a RACF keyring to access the SSL cert when we use curl ?

3. The file to be uploaded to Nexus would be also specified in the curl command, which seems to be supporting USS file path only,

is curl command able to support a zos dataset instead of a USS file ? 

Alexander Klochkov's profile image
ROCKETEER Alexander Klochkov

Hi Tony,
1.
a. You can check the default location of cacert.pem with curl-config --ca command and update it with your SSL cert.
b. Alternatively, use CURL_CA_BUNDLE env var:export CURL_CA_BUNDLE=/you/cacert/location/cacert.pem
2. 
No
3.
The key--data or--data-binary can be used for that, e.g.:
--data @"//'YOUR.DS.HERE'" or
--data-binary @"//'YOUR.DS.HERE'"

Thanks,
Alexander