Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个简单的 shell 脚本,它使用 curl 从远程 URL 获取响应。问题是我将上述 URL 迁移到 HTTPS,现在 curl 返回一个空字符串。似乎设置 CURLOPT_SSL_VERIFYHOST 选项应该可以解决问题,但是如何在 shell 脚本中设置此选项?还有其他选择/解决方法吗?
#! /bin/bash URL=$(curl -u user:pass -A "Mozilla" https://example.com/ddns/update.php)
今天,我碰巧遇到了同样的问题。既没有-k也--insecure没有-L奏效,但是由于某种原因,我将它们混合在一起并且奏效了。
-k
--insecure
-L
我不能说为什么会这样,但这对我有用:
curl -kL https://...
PS:这是一个 Jupyter 笔记本服务器。我的猜测是它同时使用 ssl 和重定向。