HTTPS and SSL3_GET_SERVER_CERTIFICATE:certificate verify failed, CA is OK

I am using XAMPP for development. Recently I upgraded my installation of xampp from an old version to 1.7.3. Now when I curl HTTPS enabled sites I get the following exception Fatal error: Uncaught exception ‘RequestCore_Exception’ with message ‘cURL resource: Resource id #55; cURL error: SSL certificate problem, verify that the CA cert is OK. … Read more

Getting HTTP code in PHP using curl

I’m using CURL to get the status of a site, if it’s up/down or redirecting to another site. I want to get it as streamlined as possible, but it’s not working well. <?php $ch = curl_init($url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_TIMEOUT,10); $output = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return $httpcode; ?> I have this wrapped in a … Read more

PHP – SSL certificate error: unable to get local issuer certificate

I’m running PHP Version 5.6.3 as part of XAMPP on Windows 7. When I try to use the Mandrill API, I’m getting the following error: Uncaught exception ‘Mandrill_HttpError’ with message ‘API call to messages/send-template failed: SSL certificate problem: unable to get local issuer certificate’ I already tried everything I read on StackOverflow, including adding the … Read more

Execute bash script from URL

Say I have a file at the URL “http://mywebsite.com/myscript.txt” that contains a script: #!/bin/bash echo “Hello, world!” read -p “What is your name? ” name echo “Hello, ${name}!” And I’d like to run this script without first saving it to a file. How do I do this? Now, I’ve seen the syntax: bash < <(curl … Read more

curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number

When I try to connect to any server (e.g. google.com) using curl (or libcurl) I get the error message: curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number Verbose output: $ curl www.google.com –verbose * Rebuilt URL to: www.google.com/ * Uses proxy env variable no_proxy == ‘localhost,127.0.0.1,localaddress,.localdomain.com’ * Uses proxy env variable http_proxy == ‘https://proxy.in.tum.de:8080’ * Trying 131.159.0.2… … Read more

Using curl POST with variables defined in bash script functions

When I echo I get this, which runs when I enter it into the terminal curl -i \ -H “Accept: application/json” \ -H “Content-Type:application/json” \ -X POST –data ‘{“account”:{“email”:”[email protected]”,”screenName”:”akdgdtk”,”type”:”NIKE”,”passwordSettings”:{“password”:”Starwars1″,”passwordConfirm”:”Starwars1″}},”firstName”:”Test”,”lastName”:”User”,”middleName”:”ObiWan”,”locale”:”en_US”,”registrationSiteId”:”520″,”receiveEmail”:”false”,”dateOfBirth”:”1984-12-25″,”mobileNumber”:”9175555555″,”gender”:”male”,”fuelActivationDate”:”2010-10-22″,”postalCode”:”10022″,”country”:”US”,”city”:”Beverton”,”state”:”OR”,”bio”:”This is a test user”,”jpFirstNameKana”:”unsure”,”jpLastNameKana”:”ofthis”,”height”:”80″,”weight”:”175″,”distanceUnit”:”MILES”,”weightUnit”:”POUNDS”,”heightUnit”:”FT/INCHES”}’ https://xxx:[email protected]/xxxxx/xxxx/xxxx But when run in the bash script file, I get this error curl: (6) Could not resolve host: application; nodename nor … Read more