Bitcoin Forum
December 06, 2016, 02:12:43 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: « 1 [2]  All
  Print  
Author Topic: [CLOSED] Bounty 5 BTC - Acessing CampBX API with PHP  (Read 2784 times)
paraipan
Legendary
*
Offline Offline

Activity: 924


Firstbits: 1pirata


View Profile WWW
July 28, 2012, 11:19:05 PM
 #21

Watching thread, and the skills some of you show off in here.

BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
unclemantis
Member
**
Offline Offline

Activity: 98


(:firstbits => "1mantis")


View Profile
July 29, 2012, 01:03:23 AM
 #22

Code:
sudo apt-get install ruby1.9.1

Solved!

19nUeM1qJmkpr8KYf9frtfWj6MCX7jpjb

PHP, Ruby, Rails, ASP, JavaScript, SQL
20+ years experience w/ Internet Technologies
Bitcoin OTC | GPG Public Key                                                                               thoughts?
CA Coins
Donator
Sr. Member
*
Offline Offline

Activity: 306


View Profile
July 29, 2012, 08:12:38 AM
 #23

Does curl_error() give you anything? http://php.net/manual/en/function.curl-error.php

Nope, no errors.

Quote

Try using different SSL versions:

Code:
curl_setopt($curl, CURLOPT_SSLVERSION,3); // or try setting to 2


Bingo!  That did the trick.  

If verifyhost set as 1, then also need the line to point to the certificate, but here is a working code.

Code:
$params['user'] = "myUser";
$params['pass'] = "myPass";
$postData = http_build_query($params, '', '&');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://CampBX.com/api/myfunds.php");
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
//curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_CAINFO, "path to certificate.crt");
//curl_setopt($ch,CURLOPT_POST, true);
//curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
curl_setopt($ch, CURLOPT_SSLVERSION,3); // or try setting to 2  //This did the trick

$res = curl_exec($ch);
print_r($res);
echo 'Curl error: ' . curl_error($ch);
curl_close($ch);


Thanks to everybody for your help.  scribe, can you please send or post your address for the 5BTC bounty?  Also, to BCB, gweedo, unfinishe, and drakahn, please send or post your address so I can send you a small donation for helping out.  
drakahn
Hero Member
*****
Offline Offline

Activity: 504



View Profile
July 29, 2012, 08:24:15 AM
 #24

1MEYHC9c5gmJ4TPWCoFWW9Ey1TGLUjfMKi

Glad you got it worked out

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
BCB
CTG
VIP
Legendary
*
Offline Offline

Activity: 966


BCJ


View Profile
July 29, 2012, 01:01:20 PM
 #25

Ahhhh.  MS Server requires the Certificate. Linux does not.  Good to know. It makes me think that Campbx is also hosted on an MS Server box as you said you could authenticate to the other exchanges but not to Campbx.  Glad you got it working!
unclemantis
Member
**
Offline Offline

Activity: 98


(:firstbits => "1mantis")


View Profile
July 29, 2012, 02:03:44 PM
 #26

PHP on IIS? UGH! No wonder!

DOOD! Switch to Linux for ANYTHING OPEN SOURCE!

PHP, Ruby, Rails, ASP, JavaScript, SQL
20+ years experience w/ Internet Technologies
Bitcoin OTC | GPG Public Key                                                                               thoughts?
scribe
Sr. Member
****
Offline Offline

Activity: 295



View Profile WWW
July 29, 2012, 03:06:06 PM
 #27

Try using different SSL versions:

Code:
curl_setopt($curl, CURLOPT_SSLVERSION,3); // or try setting to 2


Bingo!  That did the trick.  


Thanks to everybody for your help.  scribe, can you please send or post your address for the 5BTC bounty?  Also, to BCB, gweedo, unfinishe, and drakahn, please send or post your address so I can send you a small donation for helping out.  

Awesome - my 'tweak stuff til it does something different' approach works again... PM'd.

Now just got to figure out why php on osx hates anything https.

blocknois.es Bitcoin music label. ~ New release: This Is Art

Read: Bitcoin Life | Wear: FUTUREECONOMY
unclemantis
Member
**
Offline Offline

Activity: 98


(:firstbits => "1mantis")


View Profile
July 29, 2012, 03:57:55 PM
 #28

Try using different SSL versions:

Code:
curl_setopt($curl, CURLOPT_SSLVERSION,3); // or try setting to 2


Bingo!  That did the trick.  


Thanks to everybody for your help.  scribe, can you please send or post your address for the 5BTC bounty?  Also, to BCB, gweedo, unfinishe, and drakahn, please send or post your address so I can send you a small donation for helping out.  

Awesome - my 'tweak stuff til it does something different' approach works again... PM'd.

Now just got to figure out why php on osx hates anything https.

Saint Jobs needs to spy on you. He can't spy on your through https Tongue

PHP, Ruby, Rails, ASP, JavaScript, SQL
20+ years experience w/ Internet Technologies
Bitcoin OTC | GPG Public Key                                                                               thoughts?
gweedo
Legendary
*
Offline Offline

Activity: 1246


Java, PHP, HTML/CSS Programmer for Hire!


View Profile WWW
July 29, 2012, 04:11:52 PM
 #29

In sig and yea get on Linux do much better than windows for dev and server

Want to earn 2500 SATOSHIS per hour? Come Chat and Chill in https://goseemybits.com/lobby
CA Coins
Donator
Sr. Member
*
Offline Offline

Activity: 306


View Profile
July 29, 2012, 07:24:50 PM
 #30

Yeah, I agree.  Linux is a good system and much better for running PHP.  I have a few thousand lines of code in classic asp so the migration has been happening slowly but surely. 

Thanks again for everybody's help.  The bounty and most of the donations have been sent.  BCB, I got a 2BTC donation coming your way if you're interested (I don't see an address in your sig).
gweedo
Legendary
*
Offline Offline

Activity: 1246


Java, PHP, HTML/CSS Programmer for Hire!


View Profile WWW
July 29, 2012, 07:28:55 PM
 #31

Received donation thank you and good luck with that asp migration

Want to earn 2500 SATOSHIS per hour? Come Chat and Chill in https://goseemybits.com/lobby
BCB
CTG
VIP
Legendary
*
Offline Offline

Activity: 966


BCJ


View Profile
July 29, 2012, 07:44:57 PM
 #32

Yeah, I agree.  Linux is a good system and much better for running PHP.  I have a few thousand lines of code in classic asp so the migration has been happening slowly but surely. 

Thanks again for everybody's help.  The bounty and most of the donations have been sent.  BCB, I got a 2BTC donation coming your way if you're interested (I don't see an address in your sig).

I appreciate that but I didn't solve the problem.  Happy to help you out.

Put the 2BTC towards a new linux box! Wink

Thanks!
CA Coins
Donator
Sr. Member
*
Offline Offline

Activity: 306


View Profile
July 29, 2012, 08:14:14 PM
 #33

Cool dude.  Thanks for your help!
scribe
Sr. Member
****
Offline Offline

Activity: 295



View Profile WWW
July 29, 2012, 08:48:44 PM
 #34

Thanks for the donation, CA - I'll keep it away from satoshidice I think Smiley I do a fair bit of dev work on Windows Server and then deploy to a Linux box, so I'll keep an eye out for this one in future...

Now just got to figure out why php on osx hates anything https.

Saint Jobs needs to spy on you. He can't spy on your through https Tongue

Pretty sure the big bearded dude in the sky could pull a MITM attack if he wanted to. Does God have root?

blocknois.es Bitcoin music label. ~ New release: This Is Art

Read: Bitcoin Life | Wear: FUTUREECONOMY
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!