简体   繁体   English

Libcurl SSL证书验证

[英]Libcurl SSL certificate verification

I made a simple program to send/receive XML from a server through HTTPS and libcurl. 我编写了一个简单的程序,可以通过HTTPS和libcurl从服务器发送/接收XML。 I just disbaled the certificate & server verification by setting CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST as 0. With this the connection is happening from one machine and able to get XML. 我只是通过将CURLOPT_SSL_VERIFYPEER和CURLOPT_SSL_VERIFYHOST设置为0来取消证书和服务器验证。这样一来,连接就在一台计算机上进行并可以获取XML。 But from other machine, I get 77 error from curl always. 但是从其他机器上,我总是从curl中收到77错误。 But when I run curl command with -k option on the error-machine, I get proper XML from server. 但是,当我在错误计算机上使用-k选项运行curl命令时,我从服务器获取了正确的XML。 http://curl.haxx.se/docs/sslcerts.html says the above two options are enough, aren't they enough? http://curl.haxx.se/docs/sslcerts.html说上述两个选项就足够了,不是吗? How can I make the libcurl library to work the same way as curl command in this case? 在这种情况下,如何使libcurl库以与curl命令相同的方式工作?

liburl version, On success machine: curl-7.15.5-9.el5, curl-devel-7.15.5-9.el5. liburl版本,在成功机器上:curl-7.15.5-9.el5,curl-devel-7.15.5-9.el5。

liburl version, On error-machine :curl-7.19.7-26.el6_1.2.x86_64, curl-7.19.0-8.el6.x86_64, libcurl-7.19.7-26.el6_1.2.i686, libcurl-7.19.7-26.el6_1.2.x86_64 liburl版本,在错误机器上:curl-7.19.7-26.el6_1.2.x86_64,curl-7.19.0-8.el6.x86_64,libcurl-7.19.7-26.el6_1.2.i686,libcurl- 7.19.7-26.el6_1.2.x86_64

Platfor: Linux, Language: C. Platfor:Linux,语言:C。

发现:)二进制文件是使用旧的lib-curl版本3编译的,但是错误机器只有版本4。另外有人用版本3的名称链接到版本4,因此在使用libcurl4编译后,它就像魅力一样工作。 ::)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM