Htmldom icon indicating copy to clipboard operation
Htmldom copied to clipboard

SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Open newroseji opened this issue 8 years ago • 1 comments

I got following Error when I tried with secured url: ErrorException in Htmldom.php line 178: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

However, I fixed this issue with following extra arguments passed in load_file() method after $args = func_get_args(); line in Htmldom class.

$arrContextOptions=array( "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ), ); $args[1]=false; $args[2]=stream_context_create($arrContextOptions);

Just wondering if the author can push it built-in with much cleaner/optimized way instead of hard-coding like I did above.

newroseji avatar Feb 27 '17 16:02 newroseji

@yangqi I thought that the issue is fixed. But, again I got stuck with another similar issue.

ErrorException in Htmldom.php line 196: file_get_contents(): php_network_getaddresses: getaddrinfo failed: The requested name is valid, but no data of the requested type was found.

I tried the original method and above but in vain.

Help will be greatly appreciated!

newroseji avatar Mar 23 '17 18:03 newroseji