Skip to content

Commit

Permalink
fix: ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirvolek committed Oct 24, 2023
1 parent 571296a commit 05c2130
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import fastifyPostgres from '@fastify/postgres';
import * as Sentry from '@sentry/node';
import fastify, { FastifyInstance, FastifyRequest } from 'fastify';
import os from 'os';

import { getConfig } from './config.js';
import { registerRoute } from './utils/common.js';
import { errorHandler, notFoundHandler } from './utils/error-handler.js';

import { createRequire } from 'module';

const esmRequire = createRequire(import.meta.url);
const packageJson = esmRequire('../package.json');

Expand Down Expand Up @@ -56,6 +55,7 @@ const start = (options = {}): FastifyInstance => {
database: config.dbSync.database,
max: config.dbSync.maxConnections,
password: config.dbSync.password,
ssl: config.dbSync.ssl,
});

// addresses
Expand Down
2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const loadConfig = () => {
const databaseSyncMaxConnections = process.env.BLOCKFROST_CONFIG_DBSYNC_MAX_CONN
? Number(process.env.BLOCKFROST_CONFIG_DBSYNC_MAX_CONN)
: config.get<number>('dbSync.maxConnections');
const ssl = config.has('dbSync.ssl') ? { rejectUnauthorized: false } : false;

// blockfrost network
const network = process.env.BLOCKFROST_CONFIG_NETWORK ?? config.get('network');
Expand All @@ -59,6 +60,7 @@ export const loadConfig = () => {
password: databaseSyncPassword,
database: databaseSyncDatabase,
maxConnections: databaseSyncMaxConnections,
ssl,
},
network: network as Network,
tokenRegistryUrl,
Expand Down

0 comments on commit 05c2130

Please sign in to comment.