In these two days, the service has been reporting when calling Baidu’s addressing and positioning interface and reverse address resolution:
file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure
The query results of the interface are affected, and finally the curl call problem is solved:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_FAILONERROR, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSLVERSION, 4);
$reponse = curl_exec($ch);
CURLOPT_SSLVERSION Fetch value and meaning
CURL_SSLVERSION_TLSv1_2 requires php version >= 5.5.19
TLS 1.1 and TLS 1.2 are supported since OpenSSL 1.0.1
CURL_SSLVERSION_DEFAULT (0)
CURL_SSLVERSION_TLSv1 (1),
CURL_SSLVERSION_SSLv2 (2),
CURL_SSLVERSION_SSLv3 (3),
CURL_SSLVERSION_TLSv1_0 (4),
CURL_SSLVERSION_TLSv1_1 (5),
CURL_SSLVERSION_TLSv1_2 (6).
Read More:
- PHP curl error: SSL certificate problem: unable to get local issuer certificate settlement program
- [PHP] Array to string conversion error when sending data in post
- [Solved] PHP getimagesize(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL
- [Solved] getObject: FAILED RequestCoreException: cURL resource: Resource id #78; cURL error: SSL certificate
- Mac installs the php Swoole extension and appears Enable openssl support, require openssl library or fatal error:’openssl/ssl.h’ file not found
- [Solved] iis cURL error 60: SSL certificate problem: unable to get local issuer certificate
- [Solved] file_get_contents(): SSL operation failed with code 1
- Fatal error: Function name must be a string in
- [Solved] cURL error 60: SSL certificate problem: unable to get local issuer certificate
- [Solved] has been blocked by CORS policy: Response to preflight request doesn‘t pass access control check: No
- ThinkPHP interface cross domain request error [Solved]
- Tp6 Cannot enable error [How to Solve]
- [Solved] PHP installation Phalcon expansion error
- [PHP] Solve the problem that the new version of Chrome’s same-site policy cannot record cookies across domains
- [Solved] WordPress Upgrade PHP 5.6 to 7.x Fatal error: Uncaught Error: Call to undefined function mysql_connect()
- [Solved] PHPMailer Failed to Send Email: SMTP Error: Could not connect to SMTP host.
- [Solved] Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path:
- [Solved] PHPMailer Error: SMTP ERROR: Failed to connect to server: (0)
- How to solve Magento 500 internal server errors
- Configure: error: Cannot find libz error appears when brew installs php70