We have curl installed from Ported Tools from around 2018 I believe.
When using SSL (i.e. without "-k") it fails on most LPARS as follows
curl -vvv --cacert /u/userid/certs/cacert.crt https://registry.hub.docker.com/v1/repositories/ibmcom/etcd/tags
Setting CURL_CA_BUNDLE yields the same result, as does setting --cafile. (export CURL_CA_BUNDLE="/u/userid/certs/cacert.crt")
I reviewed my .profile and the only other related setting looks fine: export OPENSSL_CONF=/apps/4g00/Ported_tools/curl/ssl/openssl.cnf
The system /etc/profile also has nothing obvious.
It does work on one LPAR, which conveniently has a shared /u/userid/.profile with a system that fails.
The same curl command below is used on both systems.
The system /etc/profile between the two systems look the same.
The working host happens to be z/OS 2.5 but according to my notes it also worked when it was z/OS 2.4.
Different locations for the ca file yield the same results.
Not coding --cacert and CURL_CA_BUNDLE seems to "work" in that curl goes with the default ca-certs which doesn't have our required company issued CAs.
* SSL certificate problem: unable to get local issuer certificate
* Curl_http_done: called premature == 1
=> Any idea of what to look at next? I'm thinking it's some kind of USS security access issue to the specified CAfile (/u/userid/certs/cacert.crt), but the permissions are fine.
Below is the relevant info that "-vvv" provides
Bruce
Versions:
- curl --version => curl 7.52.1 (i370-ibm-openedition) libcurl/7.52.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.18.1
- openssl version => OpenSSL 1.0.2k 26 Jan 2017
Detailed error flow: (
< HTTP/1.1 200 Connection established
<
* Proxy replied OK to CONNECT request
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* error setting certificate verify locations:
CAfile: /u/q3fjj4g/certs/cacert.crt
CApath: none
* Curl_http_done: called premature == 0
* Closing connection 0
curl: (77) error setting certificate verify locations:
CAfile: /u/userid/certs/cacert.crt
CApath: none
------------------------------
Bruce Marshall
Architect, Infrastructure
Royal Bank of Canada
Toronto ON CA
------------------------------
