The public platform adjusts the SSL security policy. Please upgrade it.
In recent times, https encryption protocol SSL has exposed a high-risk vulnerability, which may cause hackers to listen to the data transmitted over the network, posing a threat to user information, network account and password, and other security threats. To ensure user information and communication security, the public platform will disable SSLv2 and SSLv3 support, and does not support some client calls using SSLv2, SSLv3, or a lower version.Developers who are still using these versions should fix the upgrade as soon as possible before January 1, November 30.
Note: developers who develop mobile applications and Web applications through the open platform (open.weixin.qq.com) also need to repair and upgrade.
We recommend that you use the following methods to fix the problem:
OpenSSL (http://www.openssl.org) can use the ssl_ctx * ssl_ctx_new (const ssl_method * method) function to set the ssl client request method, using tlsv1_client_method or a later version.
Example 1 (PHP ):
Curl_setopt ($ curl, curlopt_sslversion, curl_sslversion_tlsv1 );
Example 2 (C #):
System. net. servicepointmanager. securityprotocol = securityprotocoltype. TLS | securityprotocoltype. tls11 | securityprotocoltype. tls12 example
A https_request function is used to generate a custom menu.
function https_request($url, $data = null){ $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); if (!empty($data)){ curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); } curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($curl); curl_close($curl); return $output;}
Now you want to add SSL version control
function https_request($url, $data = null){ $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1); if (!empty($data)){ curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); } curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($curl); curl_close($curl); return $output;}
The public platform adjusts the SSL security policy and the developer's Upgrade Method