RESTful API with PHP

I am trying to access my becon fleet data using RESTful API that I created with PHP. When I run the script on my server I get the following error message.

[31m ERROR e[0m :SSL certificate problem: unable to get local issuer certificate

So I understand that “All requests should be made over the HTTPS protocol.”

Does that mean that I cannot make any request from my server becasue it is using http not https?

This message probably means there was some problem validating the SSL certificate from Estimote Cloud. I think the only two reasons why you would get this are:

  • the list of certificate-authorities/root-certificates in your system (or the library you’re using if it has its own, but usually it’s the OS) is outdated
  • your network provider is doing some shenanigans and possibly replaces our certificate with their own (I’ve seen this on corporate networks before)

You could try running your PHP script on a different machine and network, see if you’re getting the same problem.

Most likely there’s an option somewhere in your networking library to ignore certificate errors/validation, but keep in mind this will open you to man-in-the-middle attacks. (That is, somebody else pretends to be Estimote Cloud, but they don’t/can’t have a legit certificate for cloud.estimote.com, so normally you’d get a certificate error preventing you from communicating with them. But if you disable the certificate errors, you’re not protected this way.)