Closed zerogods closed 9 years ago
Hey, are you still seeing this?
The code seems fine. Could you provide the file you're using? Just the bits that lead to the error are fine.
We don't see an issue on our side.
Still getting same error.. I cloned this repo and copied block_io.php file to /libs. [PHP 5.4.16, GMP 4.3.1, Mcrypt 2.5.8, cURL 7.19.7] This is my /blockio_test.php
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
require_once '../libs/block_io.php'; //Block.io API
$version = 2; // API version
$pin ="<BlockIO PIN>"; //Block_io main pin
$apiKey = "<DOGE testnet API KEY>"; //DOGE testnet
$block_io = new BlockIo($apiKey, $pin, $version);
$Address = $block_io->get_my_addresses(); //this line is throwing error
//print_r($Address);
Hi,
We're unable to reproduce this error with the given script aswell. I've filled the script out with a dummy PIN and API Key so you know the format. If you still get this error, we'll investigate further with the exact versions of extensions in use.
Script used:
<?php
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
require_once '/home/user/php-libs/lib/block_io.php'; //Block.io API
$version = 2; // API version
$pin ="abraCadabra1"; //Block_io main pin
$apiKey = "364f-754c-f129-99cd"; //DOGE testnet
$block_io = new BlockIo($apiKey, $pin, $version);
$Address = $block_io->get_my_addresses(); //this line is throwing error
print_r($Address);
?>
Response:
$ php test.php
stdClass Object
(
[status] => success
[data] => stdClass Object
(
[network] => DOGETEST
[addresses] => Array
(
[0] => stdClass Object
(
[user_id] => 0
[address] => 2N1GoeAj471UJvu8RfqL3jZ88TF8iTX22hG
[label] => default
[available_balance] => 100000.00000000
[pending_received_balance] => 0.00000000
)
)
)
)
Namaste I'm still getting same error on localhost [WAMP] & openshift.
Hi, does your API key on the API Docs on the site? If yes, this seems to be a json_decode error. However, we're yet to verify this.
Simplest way to see the call works on Block.io: browse to https://block.io/api/v2/get_my_addresses/?api_key=YOURAPIKEY
Let us know.
I've created another lib using cURL API for basic send/receive functions. Still need this lib for dtrust.
My testnet with cURL API is good and ready ~> https://test.NepalBit.co.in
Oopss!! I forgot to restart WAMP after updating php.ini with path to cacert.pem. This lib was throwing same error in WAMP but now it's working fine. :)
Maybe this problem is part of openshift & recent bugs in SSL. So I tried few workarounds in openshift but failed.. Finally I removed [line 90] in block_io.php
// curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'TLSv1'); // enforce use of TLSv1
and it's working fine.
Tried catching curl error and found
Error: 59: Unknown cipher in list: TLSv1
Is it ok to remove that line and add curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
??
It's alright to remove it as long as it works. Block.io's servers will only support TLS, and not SSL. As long as your cURL extension default to TLSv1, you'll be fine.
Glad you got this sorted out, and thanks for letting us know :)
If there isn't much else to it, I'll close this issue. We're not going to remove that line by default just yet -- some folks will use outdated cURL that will cause problems because it defaults to SSLv3.
Thanks for this cool API and your fast replies.. :)
Peace!!
Maybe I'm doing something wrong?? Here's my code..
RETURNS