我正在尝试从某个网站(实际上是任何一个网站)获得答复,但是我不断收到以下错误消息:
卷曲:(35)schannel:下一个InitializeSecurityContext失败:未知错误(0x80092012)-撤消功能无法检查证书的撤消。
我正在使用的命令是:
curl -i https://www.gmit.ie
在尝试从api.twitter.com网站获得响应之前,我可以使其正常工作。之后,它会继续返回错误。
我可以将命令更改为:
curl -i "https://www.gmit.ie" --ssl-no-revoke
这确实有效,并且为我提供了一个正确的响应,其中包含标题以及网站的整个html代码。
如何使curl命令再次正确地工作?
?其他说明:
答案 0 :(得分:1)
我来晚了,但我认为值得指出您可能会感到困惑。
吊销功能无法检查证书的吊销。
您只会在“ https”上获得它,我怀疑它还有其他原因为什么会在Twitter上出现。关于该问题还有其他问题,您已经找到了解决方法--ssl-no-revoke。
给我一个准正确的响应,其中包含标题,还包含网站的整个html代码。
您忘了说什么是“正确的答案”。您将获得所请求URL的文档(通常是“ html代码”)(而不是整个网站)。
根据您的curl版本,您可以在此处找到文档,例如: https://www.mit.edu/afs.new/sipb/user/ssen/src/curl-7.11.1/docs/curl.html
我改用http以获得简短的文档,并提供我认为正确的输出。
curl -i http://www.gmit.ie
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 178 100 178 0 0 178 0 0:00:01 --:--:-- 0:00:01 1034
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Mon, 21 Sep 2020 15:57:06 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: https://www.gmit.ie/
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
您是要使用-I /-head而不是-i /-include吗?
curl -I http://www.gmit.ie --ssl-no-revoke
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 178 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Mon, 21 Sep 2020 15:56:40 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: https://www.gmit.ie/
如果您得到相同的结果,请放心您具有正确的输出。
curl -i“ https://www.gmit.ie” --ssl-no-revoke
PS。如文档所述,请养成将选项放在URL之前的习惯,即使它也是如此。