-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add HTTPS to GraphQL and NextJS Server #376
Conversation
verified ssl works |
verified communication between app and graphql work over ssl |
const app = next({ dev }) | ||
const handle = app.getRequestHandler() | ||
// @ts-ignore | ||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the point of https so we can now remove this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the ddf cert is self signed, we still need this to get past that auth rejection
@@ -1,6 +1,6 @@ | |||
import url from 'url' | |||
const defaultDdfUrl = 'https://localhost:8993' | |||
const defaultWebappUrl = 'http://localhost:3000' | |||
const defaultWebappUrl = 'https://localhost:3000' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized, does the graphql server need to know about the webapp at all? This key should be able to be removed unless I'm missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used for the CORS policy. Would it be better to allow from all origins?
revelio/graphql/src/apollo-server/index.tsx
Lines 63 to 66 in 941149b
cors: { | |
origin: config('WEBAPP_LOCATION'), | |
credentials: true, | |
}, |
handle(req, res, parsedUrl) | ||
}).listen(3000, err => { | ||
if (err) throw err | ||
console.log('> Ready on https://localhost:3000') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't CI have failed with this console.log
are we no longer enforcing that? Or are you ignoring it for this case and I'm just not seeing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was able to add this to the eslint config for the app directory but not graphql. for some reason the no-console rule won't play nicely with typescript files
fixes #256