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

App construction failed error occurs when trying to go up a directory when specifying key/cert name #131

Open
modelorona opened this issue Nov 6, 2020 · 1 comment

Comments

@modelorona
Copy link

Hiya,

This is my first time using this library, so please excuse me if this has already been brought up before. I did look for quite some time and could not manage to find anything related to it.

The issue occurs when I specify the name for the key_file_name and cert_file_name parameters in SSLApp(). I try to specify it like this

const Uws = require('uWebSockets.js');

Uws.SSLApp({
        key_file_name: '../certs/key.pem',
        cert_file_name: '../certs/cert.pem',
        passphrase: 'password'
})

where the certs folder is one above where the javascript file resides in.

However, if I move the certs folder to where the javascript file is, and change the call to

Uws.SSLApp({
        key_file_name: 'certs/key.pem',
        cert_file_name: 'certs/cert.pem',
        passphrase: 'password'
})

it works as expected.

The error that is printed out is App construction failed.

When I ran node --trace-uncaught ..., this is the output:

internal/modules/cjs/loader.js:968
  throw err;
  ^

Error: Cannot find module '/home/user/AndroidStudioProjects/project/src/server/...'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Thrown at:
    at Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Module._load (internal/modules/cjs/loader.js:841:27)
    at executeUserEntryPoint (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47

I couldn't find anything in the documentation about how the format of the string should be, so I assumed that any valid path would work. But the error suggests otherwise.

@ghost ghost transferred this issue from uNetworking/uWebSockets.js Nov 8, 2020
@partyblob
Copy link

this is the wrong repo, https://github.com/uNetworking/uWebSockets.js (also the issue has been solved it appears)

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

2 participants