API (https with invalid certificate)

edited April 2015 in How To...

If the API I am using has security settings, is there code that can be used to override this. For example bellow the first 2 work but the third does not because of security settings. Can I code around this?

import proxml.*;

XMLInOut xmlInOut;

void setup(){
  size(600, 200);
  xmlInOut = new XMLInOut(this);
  // xmlInOut.loadElement("http://" + "api.wefeelfine.org:8080/ShowFeelings?display=xml&returnfields=feeling,postdate,sentence&limit=50"); 
  //xmlInOut.loadElement("http://" + "api.wefeelfine.org:8080/ShowFeelings?display=xml&returnfields=imageid,feeling,sentence,posttime,postdate,posturl,gender,born,country,state,city,lat,lon,conditions&feeling=sad&city=tokyo&limit=500&extraimages=50"); 
  //xmlInOut.loadElement("https://" + "api.cabdirect.cab.semcs.net/select?q=dog");
  xmlInOut.loadElement("http://" + "cabisearch:20100/liveCore/select?q=dog");
}

void xmlEvent(proxml.XMLElement element){
  for(int i = 0; i < element.countChildren(); i++) {
    println(element.getChild(i).getAttribute("name"));
    println("\t"+element.getChild(i).getAttribute("name"));
  }
}

Answers

  • Ok. Let me try that again then. This API is set to a private secure setting. Can I un secure the URL in Processing by adding code to do so? https://api.cabdirect.cab.semcs.net/select?q=dog

  • using wget (with --no-check-certificate) i get:

    WARNING: cannot verify api.cabdirect.cab.semcs.net's certificate, issued by `/C=UK/ST=Sussex/L=Brighton/O=semantico/CN=semantico Certificate Authority 2013':
      Unable to locally verify the issuer's authority.
    HTTP request sent, awaiting response... 401 Unauthorized
    Authorisation failed.
    

    so even ignoring the certificate i get a 401

  • Thanks for your reply. But if I could just get 1 line of code that overrides the privacy security settings on api's that would be great.

  • Sorry, but I was just supplying details that should've been in your original post. I'm not sure there's a fix for it - even ignoring the dodgy certificate I get asked for auth details.

Sign In or Register to comment.