how to login in redmine from php?

Added by Andre Lee 10 months ago

tried to simulate here: (works perfectly well)

my login test:

I get the next error:
file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
file_get_contents(): Failed to enable crypto
file_get_contents($url): Failed to open stream: operation failed

tried to activate ssl (but it does not give anything):
'ssl' => array('cafile' => 'cacert.pem', //from
'verify_peer'=> true,
'verify_peer_name'=> true

implemented two versions of cookies parse, because I am not sure what is more correct
see function get_redmine_cookie
//return $result_without_params;
return $result_with_params;

what am I doing wrong?