Friday before work, in the computer room to pay the department's certificate to switch, seemingly peaceful; Monday came to the office of another project colleague said the payment interface request access is not; Think about whether you have switched the certificate itself; Here are the troubleshooting steps:
1, the first offline browser access interface:
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7C/EE/wKioL1bc4iii-aRfAABLTBWB4D0174.png "title=" QQ picture 20160307100117.png "alt=" Wkiol1bc4iii-arfaabltbwb4d0174.png "/>
* Access is a GET request can return data, stating that the certificate is not a problem, then the local computer room communication problems or code problems; Login Machine View
2. Login with the code of the server to view:
>>> Import urllib2>>> Import urllib>>> html = Urllib2.urlopen ("https:xxxxx?jsondata={ xxxxxxx ") # # #用匿名指代 >>> print Html<addinfourl at 24155344 whose FP = <socket._fileobject object at 0x16e9ed0 >>>>> dir (HTML) # #由于返回的是对象, see what the specific methods [' __doc__ ', ' __init__ ', ' __iter__ ', ' __module__ ', ' __repr__ ', ' Close ', ' Code ', ' Fileno ', ' FP ', ' GetCode ', ' geturl ', ' headers ', ' info ', ' msg ', ' Next ', ' read ', ' ReadLine ', ' readlines ', ' u RL ']>>> print Html.next () # #查看next有返回值 {"Success": 2963.48}
* On the local execution has a return result, indicating that communication is not a problem, and can return the results of the server should also be no problem, then the rest is the PHP code
3, Baidu found, the solution way:
In the requested code, add the following:
curl_setopt ($ch, Curlopt_ssl_verifypeer, false);
* Cause: The SSL certificate cannot be verified in the local computer room, then the code is skipped.
This time is just a simple troubleshooting process, but also see the python in the daily Operation Dimension also played a role, mainly is the idea steps clear step by step.
This article is from the "Little Luo" blog, please be sure to keep this source http://xiaoluoge.blog.51cto.com/9141967/1748274
Troubleshooting after a single SSL certificate switch