Since 0.12 RPC uses a "random cookie":https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.12.0.md#rpc-random-cookie-rpc-authentication for authentication, but it's not clear how to use this cookie when accessing RPC.
I'm trying things like the below, without success (401 Unauthorized)
$Request = array(
'http' => array(
'method' => 'POST',
'header' => "Content-type: application/json\r\n".
'Cookie: __cookie__=contentsOf.cookie',
'content' => $Params
)
);
if (!$Response = file_get_contents(BITCOIN_RPC_URL, false, stream_context_create($Request))) {
return false;
}
Every example I find online uses the user:pass authentication, I've yet to see an example using cookies.