Bitcoin Forum
April 16, 2024, 05:42:34 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: [CLOSED] Bounty 5 BTC - Acessing CampBX API with PHP  (Read 3149 times)
CA Coins (OP)
Donator
Sr. Member
*
Offline Offline

Activity: 305
Merit: 250


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

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.  
1713246154
Hero Member
*
Offline Offline

Posts: 1713246154

View Profile Personal Message (Offline)

Ignore
1713246154
Reply with quote  #2

1713246154
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
drakahn
Hero Member
*****
Offline Offline

Activity: 504
Merit: 500



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

1MEYHC9c5gmJ4TPWCoFWW9Ey1TGLUjfMKi

Glad you got it worked out

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
BCB
CTG
VIP
Legendary
*
Offline Offline

Activity: 1078
Merit: 1002


BCJ


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

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
Merit: 10


(:firstbits => "1mantis")


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

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
Merit: 250



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

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
Merit: 10


(:firstbits => "1mantis")


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

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?
CA Coins (OP)
Donator
Sr. Member
*
Offline Offline

Activity: 305
Merit: 250


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

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).
BCB
CTG
VIP
Legendary
*
Offline Offline

Activity: 1078
Merit: 1002


BCJ


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

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 (OP)
Donator
Sr. Member
*
Offline Offline

Activity: 305
Merit: 250


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

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

Activity: 295
Merit: 250



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

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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!