更改curl SSL版本 [英] Change curl SSL Version
问题描述
我使用SOAP与Web服务进行通信。我有一个运行在一个buggy服务器,但它运行良好。现在我运行这个在一个更好的服务器,但有不同的配置。
在新的服务器我收到验证错误,我认为问题是SSL版本卷曲。在某个地方我认为应该是OpenSSL。
工作服务器:在这两个服务器上执行
。 phpinfo()
SSL版本OpenSSL / 0.9.8b
不工作的服务器: SSL版本NSS / 3.13.1.0
服务器是带有CentOS v6和Parallels Plesk Panel 11.5的VPS。
Web服务需要NTLM身份验证,因此我使用此类,在旧服务器上运行正常。 http://tcsoftware.net/blog/2011/08/php-soapclient-认证/
我解决了我的问题,但它与cURL SSL版本无关。 >
我不得不改变cURL设置 CURLOPT_HTTPAUTH
从 CURLAUTH_ANY
到 CURLAUTH_NTLM
curl_setopt($ ch,CURLOPT_HTTPAUTH,CURLAUTH_NTLM);
这有点奇怪,因为根据 http://nl3.php.net/curl_setopt CURLAUTH_ANY
代表:
CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM
I'm using SOAP to communicate with a webservice. I had this running on a buggy server but it was running fine. Now I'm running this on a better server but with different configurations.
At the new server I'm getting authentification errors, I think the problem is the SSL Version of curl. Somewhere I thought that should be OpenSSL. Doing a phpinfo()
on both servers gives me a difference.
Working server: SSL Version OpenSSL/0.9.8b
.
Not working server: SSL Version NSS/3.13.1.0
Server is a VPS with CentOS v6 and Parallels Plesk Panel 11.5
EDIT
The webservice requires NTLM authentication and therefore I'm using this class, that was working fine at the old server. http://tcsoftware.net/blog/2011/08/php-soapclient-authentication/
I solved my issue, but it had nothing to do with cURL SSL version.
I had to change the cURL setting CURLOPT_HTTPAUTH
from CURLAUTH_ANY
to CURLAUTH_NTLM
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
Which is a little strange because according http://nl3.php.net/curl_setopt CURLAUTH_ANY
stands for:
CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM
这篇关于更改curl SSL版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!