1

I have the following error when I try to curl a server :

curl -u User:Pass 'https://mydomain/remote.php/dav/files/User/Folder' -X PROPFIND --data '<?xml version="1.0" encoding="UTF-8"?>'

Error is as fallowing :

curl: (60) Peer's Certificate issuer is not recognized. More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.

And when I do curl -v google.com it's working fine :

  • About to connect() to google.com port 80 (#0)
  • Trying 2a00:1450:4007:815::200e...
  • Connected to google.com (2a00:1450:4007:815::200e) port 80 (#0) GET / HTTP/1.1 User-Agent: curl/7.29.0 Host: google.com Accept: / < HTTP/1.1 301 Moved Permanently < Location: http://www.google.com/ < Content-Type: text/html; charset=UTF-8 < Date: Thu, 02 Jul 2020 07:41:54 GMT < Expires: Sat, 01 Aug 2020 07:41:54 GMT < Cache-Control: public, max-age=2592000 < Server: gws < Content-Length: 219 < X-XSS-Protection: 0 < X-Frame-Options: SAMEORIGIN <
301 Moved

301 Moved

The document has moved here. * Connection #0 to host google.com left intact

I tried :

  • yum reinstall ca-certificates

  • curl --remote-name --time-cond cacert.pem https://curl.haxx.se/ca/cacert.pem
  • mv cacert.pem /etc/ssl/certs/
  • Adding curl.cainfo="/etc/ssl/certs/cacert.pem" to php.ini
  • Restarting nginx

  • yum install ca-certificates
  • update-ca-trust force-enable
  • Restart nginx
  • cp /etc/ssl/certs/cacert.pem /etc/pki/ca-trust/source/anchors/
  • mv /etc/pki/ca-trust/source/anchors/cacert.pem /etc/pki/ca-trust/source/anchors/cert.pem
  • Restart nginx

None of them worked

executable
  • 217
  • 5
  • 15

0 Answers0