Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm getting Couldn't connect... error message, diving deeper tells me the error is certificate has expired #43

Open
RuurdBijlsma opened this issue Jun 12, 2023 · 0 comments

Comments

@RuurdBijlsma
Copy link

RuurdBijlsma commented Jun 12, 2023

Without changing anything on my end, I'm running my code again after a few months and getting Couldn't connect to ffbinaries.com API. Check your Internet connection.

I looked into what's reporting this, it's this line:

return callback(errorMsgs.connectionIssues);

Logging the err variable from there gives me:

"Error: certificate has expired
    at TLSSocket.onConnectSecure (_tls_wrap.js:1331:34)
    at TLSSocket.emit (events.js:210:5)
    at TLSSocket._finishInit (_tls_wrap.js:804:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:618:12)"

Which doesn't make any sense to me since I can access the url fine from Chrome/Postman. I'm getting the latest version of ffmpeg and ffprobe, and I've checked the url, it's correct. The url it's requesting is "https://ffbinaries.com/api/v1/latest"

Maybe the redirect has something to do with it? Anyway, I replaced the request function with fetch and it does work without issue, so maybe you could fix it that way.

This is what I cooked up real quick:

    fetch(API_URL + url).then(r => r.text().then(body => {

            var parsed;

            try {
                parsed = JSON.parse(body.toString());
            } catch (e) {
                return callback(errorMsgs.parsingVersionData);
            }

            RUNTIME_CACHE[version] = parsed;
            return callback(null, parsed);
        }).catch(e => console.warn('json err', e))
    ).catch(e => console.warn("fetch err", e))

No proper error checks here though.

I'm using node 16.20.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant