curl - Is data encrypted when using the --insecure option?

前端 未结 2 855
没有蜡笔的小新
没有蜡笔的小新 2020-11-29 07:51

I have a situation where the client makes a call through curl to a https url. The SSL certificate of the https url is self signed and therefore curl cannot do certificate va

相关标签:
2条回答
  • 2020-11-29 08:29

    Yes, the transfered data is still sent encrypted. -k/--insecure will "only make" curl skip certificate validation, it will not turn off SSL all together.

    More information regarding the matter is available under the following link:

    • curl.haxx.se - Details on Server SSL Certificates
    0 讨论(0)
  • 2020-11-29 08:34

    It will be encrypted but insecure. If you trust the certificate you should add the certificate to your certificate store instead of connecting insecurely.

    macOS: sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/new-root-certificate.crt

    Ubuntu, Debian: sudo cp foo.crt /usr/local/share/ca-certificates/foo.crt sudo update-ca-certificates

    CentOS 6: yum install ca-certificates update-ca-trust force-enable cp foo.crt /etc/pki/ca-trust/source/anchors/ update-ca-trust extract

    CentOs 5: cat foo.crt >>/etc/pki/tls/certs/ca-bundle.crt

    Windows: certutil -addstore -f "ROOT" new-root-certificate.crt

    0 讨论(0)
提交回复
热议问题