httpGet and shields.io


#1

Hi,
I am trying to retrieve the json response coming from https://img.shields.io/badge/dynamic/json.json

def getShield() {

def params = [
    uri: "https://img.shields.io/badge/dynamic",
    path: "/json.json",
    contentType: 'application/json'
]

try {
    httpGet(params) { resp ->
        log.trace resp.data
    }
} catch (e) {
    log.error "something went wrong: $e"
}

}

I cannot get the above to work, it throws the following error after install :

error something went wrong: javax.net.ssl.SSLException: java.security.ProviderException: java.security.InvalidKeyException: EC parameters error

I am stuck, any help would be greatly appreciated :slight_smile:


httpGet with https and self-signed certificate
(Steve ) #2

Sorry can’t help much in but great with this…
How are you trying to do the Httpget is it from a smartapp you’ve created?
From memory i think i read somewhere that you can’t do a Httpget directly through SmartThings and you need to do a HubAction instead, I may be wrong :joy:
I used Webcore to do a simple Httpget.


(PPO16) #3

I believe you need to authenticate first. Your call doesn’t have user name or password.

You might want to see what your PC browser does when you access it from your PC and mimic that in the URL if this is using kind of https://myurl.com?my_id=####&my_pwd=#### or any initial authentication sequence based on several httpget/response.

The SendHubCommand should not be a solution since the URL you are reaching is not a local one (in you own local network).