如何使用 curl 或任何其他命令将文件上传到带有证书的 https 服务器

如何使用 curl 或任何其他命令将文件上传到带有证书的 https 服务器

我正在尝试使用 curl 上传到我的 HTTPS 服务器。我使用 curl 进行此操作,代码如下

curl -v --cacert /tmp/WIN-CLS.vdi.com.pem -T /etc/hosts \
--user administrator:pass_123 https://xxx.xxx.xxxx.xxx

但我收到了错误

*   Trying 192.168.1.230...
* Connected to 192.168.1.230 (192.168.1.230) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /tmp/WIN-CLS.vdi.com.pem
  CApath: /etc/ssl/certs/
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, Server hello (2):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://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.

我不需要使用 -k 选项。我在 Google 上搜索了这个问题,下载了证书并在 php.ini 文件中提供了路径。但我仍然陷入这个错误。

任何帮助,将不胜感激

相关内容