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

[WIP] Update health-check.js to allow unauthorized certs #4395

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/sync-server/src/scripts/health-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
const protocol = config.https ? 'https' : 'http';
const hostname = config.hostname === '::' ? 'localhost' : config.hostname;

fetch(`${protocol}://${hostname}:${config.port}/health`)
fetch(`${protocol}://${hostname}:${config.port}/health`, {
headers: {
'X-Forwarded-Proto': protocol,
},
rejectUnauthorized: false,

Check failure

Code scanning / CodeQL

Disabling certificate validation High

Disabling certificate validation is strongly discouraged.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a health check, intended to be run on the actual host, disabling certificate validation should not be a security issue.

strict: true,
localResolveHosts: true

Check failure on line 14 in packages/sync-server/src/scripts/health-check.js

View workflow job for this annotation

GitHub Actions / lint

Insert `,`
})
.then(res => res.json())
.then(res => {
if (res.status !== 'UP') {
Expand Down
Loading