Skip to content

Commit 53b8028

Browse files
authored
Merge pull request #358 from hack-a-chain-software/main-server
Merge 'main-server' to 'develop'
2 parents 4be881b + 059b0ba commit 53b8028

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

indexer/config/config.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ const { Transaction } = require('sequelize');
1818
*/
1919
const isSslEnabled = process.env.DB_SSL_ENABLED === 'true';
2020

21+
// Determine if the server's certificate should be validated against the local CA bundle.
22+
// Defaults to true (most secure). This is only overridden if SSL is enabled AND the
23+
// DB_SSL_REJECT_UNAUTHORIZED variable is explicitly set.
24+
let rejectUnauthorized = true;
25+
if (isSslEnabled && typeof process.env.DB_SSL_REJECT_UNAUTHORIZED !== 'undefined') {
26+
rejectUnauthorized = process.env.DB_SSL_REJECT_UNAUTHORIZED !== 'false';
27+
}
28+
2129
module.exports = {
2230
/**
2331
* Development environment database configuration
@@ -41,9 +49,11 @@ module.exports = {
4149
dialectOptions: {
4250
ssl: {
4351
require: true,
44-
rejectUnauthorized: true,
45-
// Read CA certificate for SSL connection verification
46-
ca: fs.readFileSync(__dirname + '/../src/config/global-bundle.pem').toString(),
52+
rejectUnauthorized: rejectUnauthorized,
53+
// Only include the CA if we are validating the certificate
54+
...(rejectUnauthorized && {
55+
ca: fs.readFileSync(__dirname + '/../src/config/global-bundle.pem').toString(),
56+
}),
4757
},
4858
},
4959
}),

indexer/src/kadena-server/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import { createSentryPlugin } from './plugins/sentry-plugin';
5656
*
5757
* If a query exceeds this complexity, it will be rejected before execution.
5858
*/
59-
const MAX_COMPLEXITY = 2500;
59+
const MAX_COMPLEXITY = 4000;
6060

6161
/**
6262
* GraphQL schema definition

0 commit comments

Comments
 (0)