mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
SNCB: remove hard-coded SSL CA certificate chain 🐛
This commit is contained in:
parent
d2b490a4ff
commit
96f97f245e
1 changed files with 0 additions and 9 deletions
|
@ -11,13 +11,6 @@ import {parseLine} from '../../parse/line.js';
|
||||||
const baseProfile = require('./base.json');
|
const baseProfile = require('./base.json');
|
||||||
import {products} from './products.js';
|
import {products} from './products.js';
|
||||||
|
|
||||||
// `www.belgianrail.be:443` doesn't provide the necessary CA certificate
|
|
||||||
// chain for Node.js to trust the certificate, so we manually add it.
|
|
||||||
// todo: fix this properly, e.g. by letting them know
|
|
||||||
const ca = readFileSync(new URL('./digicert-sha2-secure-server-ca.crt.pem', import.meta.url).pathname);
|
|
||||||
const agent = new Agent({ca});
|
|
||||||
const transformReq = (ctx, req) => ({...req, agent});
|
|
||||||
|
|
||||||
// todo: this is ugly
|
// todo: this is ugly
|
||||||
const lineNameWithoutFahrtNr = ({parsed}) => {
|
const lineNameWithoutFahrtNr = ({parsed}) => {
|
||||||
const {name, fahrtNr} = parsed;
|
const {name, fahrtNr} = parsed;
|
||||||
|
@ -58,8 +51,6 @@ const profile = {
|
||||||
locale: 'fr-BE',
|
locale: 'fr-BE',
|
||||||
timezone: 'Europe/Brussels',
|
timezone: 'Europe/Brussels',
|
||||||
|
|
||||||
transformReq,
|
|
||||||
|
|
||||||
products,
|
products,
|
||||||
|
|
||||||
parseLine: parseHook(parseLine, lineNameWithoutFahrtNr),
|
parseLine: parseHook(parseLine, lineNameWithoutFahrtNr),
|
||||||
|
|
Loading…
Add table
Reference in a new issue