function get_from($resource, $data) {
$jdata = json_encode($data);
$ch = curl_init();
//configure CURL
curl_setopt_array($ch, array(
CURLOPT_URL => 'https://mydomain.atlassian.net/rest/api/2/project',
CURLOPT_USERPWD => '<user>' . ':' . '<password>',
CURLOPT_POSTFIELDS => $jdata,
CURLOPT_HTTPHEADER => array('Content-type: application/json'),
CURLOPT_RETURNTRANSFER => true
));
$result = curl_exec($ch);
echo "<br>";
echo curl_errno($ch);
echo "<br>";
echo curl_error($ch);
echo "<br>";
curl_close($ch);
return json_decode($result);
}
Check if you have a certificate like *.atlassian.net in your keychain tool.
If you don't have it, go to your browser and open yourdomain.atlassian.net, then click on the padlock and export the certificate(1). Open it in you keychain tool and set it to always trust.
Retry the call and see if it works.
(1) Click on the padlock > Certificate is secure > Certificate is valid > Details > Export
Hi Andre, welcome to the Community!
I'm interested in knowing a bit more about the environment you're trying to run this function on.
You could try verifying that openssl sees an Atlassian-signed certificate for the URL you're trying to connect to:
openssl s_client -connect yourdomain.atlassian.net:443
This command will also print the intermediate certs used in the chain, which will need to be in your system's trust store. DigiCert certificates should be for nearly any operating system you could be using, but one possibility might be that you've encountered a VM image that has had its certificate stores removed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.