2020-04-12 12:23:17 +00:00
|
|
|
import fs from 'fs'
|
2017-04-12 17:57:55 +00:00
|
|
|
|
2020-04-12 15:45:50 +00:00
|
|
|
function getFile (path): string {
|
2017-04-12 17:57:55 +00:00
|
|
|
if (fs.existsSync(path)) {
|
|
|
|
return path
|
|
|
|
}
|
2020-04-12 15:45:50 +00:00
|
|
|
return ''
|
2017-04-12 17:57:55 +00:00
|
|
|
}
|
|
|
|
|
2020-04-12 12:23:17 +00:00
|
|
|
export const defaultSSL = {
|
2018-03-26 18:15:25 +00:00
|
|
|
sslKeyPath: getFile('/run/secrets/key.pem'),
|
|
|
|
sslCertPath: getFile('/run/secrets/cert.pem'),
|
|
|
|
sslCAPath: getFile('/run/secrets/ca.pem') !== undefined ? [getFile('/run/secrets/ca.pem')] : [],
|
|
|
|
dhParamPath: getFile('/run/secrets/dhparam.pem')
|
2017-04-12 17:57:55 +00:00
|
|
|
}
|