Troubleshooting after a single SSL certificate switch

Source: Internet
Author: User
Tags ssl certificate

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.