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:
- [Solved] PHP getimagesize(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL
- Mac installs the php Swoole extension and appears Enable openssl support, require openssl library or fatal error:’openssl/ssl.h’ file not found
- PHP curl error: SSL certificate problem: unable to get local issuer certificate settlement program
- [Solved] file_get_contents(): SSL operation failed with code 1
- [Solved] iis cURL error 60: SSL certificate problem: unable to get local issuer certificate
- [Solved] getObject: FAILED RequestCoreException: cURL resource: Resource id #78; cURL error: SSL certificate
- [Solved] cURL error 60: SSL certificate problem: unable to get local issuer certificate
- [Solved] PHP Error: Warning: file_get_contents(): Failed to enable crypto
- [Solved] Artisan error: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes
- composer Error while processing content unencoding: Unknown failure within decompression softwar
- [PHP] Array to string conversion error when sending data in post
- [Solved] Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60
- [Solved] WordPress Upgrade PHP 5.6 to 7.x Fatal error: Uncaught Error: Call to undefined function mysql_connect()
- Fatal error: Function name must be a string in
- [Solved] Git error: You have not concluded your merge (MERGE_HEAD exists)
- [Solved] has been blocked by CORS policy: Response to preflight request doesn‘t pass access control check: No
- Configure: error: Cannot find libz error appears when brew installs php70
- ThinkPHP interface cross domain request error [Solved]
- PHP error in Windows: class’ mysqli ‘not found
- Tp6 Cannot enable error [How to Solve]