2 Replies Latest reply on Aug 16, 2017 12:28 AM by pcheah RSS
    yzhang Newbie

    How to solve SSLHandshakeException?

    Hi all,

     

    I am now using getJSON function to get the content from an url, and the code is shown as below:

     

    var params = { 

    proxyScheme: undefined /* STRING */, 

    headers: undefined /* JSON */, 

    ignoreSSLErrors: true /* BOOLEAN */,

    useNTLM: undefined /* BOOLEAN */, 

    workstation: undefined /* STRING */, 

    useProxy: true /* BOOLEAN */, 

    withCookies: undefined /* BOOLEAN */, 

    proxyHost: 'proxy.companyname.com' /* STRING */, 

    url: "http://gateway-a.watsonplatform.net/visual-recognition/api/v3/classify?api_key=9cf5fa21fe8ff3d9eaa49d0319f329ae5ee7bb89&…" /* STRING */, 

    timeout: undefined /* NUMBER */, 

    proxyPort: '8080' /* INTEGER */, 

    }; 

     

    // result: JSON

    var result = Resources["ContentLoaderFunctions"].GetJSON(params);


    I got the error message below:


    Wrapped javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Cause: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

     

    But when I change the url to https://feeds.citibikenyc.com/stations/stations.json, can get the content.

     

    Can anyone help solve this problem? Thank!