curl - 使用 --insecure 选项时数据是否加密?
我遇到一种情况,客户端通过curl 调用https url。 https url 的 SSL 证书是自签名的,因此curl 无法进行证书验证并失败。 curl 提供了一个选项 -k/--insecure
来禁用证书验证。
我的问题是,在使用 --insecure
选项时,客户端和服务器之间完成的数据传输是否已加密(对于 https url 应该如此)?我理解由于未进行证书验证而存在的安全风险,但对于这个问题我只关心数据传输是否加密。
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 validation and fails. curl provides an option -k/--insecure
which disables certificate validation.
My question is that on using --insecure
option, is the data transfer that is done between client and server encrypted(as it should be for https urls)? I understand the security risk because of certificate validation not being done, but for this question I am only concerned about whether data transfer is encrypted or not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,传输的数据仍然以加密方式发送。
-k
/--insecure
将“仅”使curl
跳过证书验证,它不会关闭 SSL (加密)全部在一起。有关此事的更多信息,请访问以下链接:
Yes, the transfered data is still sent encrypted.
-k
/--insecure
will "only" makecurl
skip certificate validation, it will not turn off SSL (encryption) all together.More information regarding the matter is available under the following link:
它将被加密但不安全。如果您信任该证书,则应该将该证书添加到您的证书存储中,而不是进行不安全的连接。
苹果系统:
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 安装 ca 证书
更新 ca-trust 强制启用
cp foo.crt /etc/pki/ca-trust/source/anchors/
update-ca-trust 提取
CentOs 5:
cat foo.crt>>/etc/pki/tls/certs/ca-bundle.crt
Windows:
certutil -addstore -f“ROOT”new-root-certificate.crt
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