(tlsFileName)
| 873 | } |
| 874 | |
| 875 | _loadTlsFile(tlsFileName) { |
| 876 | if (!tlsFileName) { |
| 877 | return undefined; |
| 878 | } |
| 879 | if (typeof tlsFileName !== 'string') { |
| 880 | throw new Error( |
| 881 | 'bad config: TLS file specification must be a string'); |
| 882 | } |
| 883 | const tlsFilePath = (tlsFileName[0] === '/') |
| 884 | ? tlsFileName |
| 885 | : path.join(this._basePath, tlsFileName); |
| 886 | let tlsFileContent; |
| 887 | try { |
| 888 | tlsFileContent = fs.readFileSync(tlsFilePath); |
| 889 | } catch (err) { |
| 890 | throw new Error(`Could not load tls file '${tlsFileName}':` + |
| 891 | ` ${err.message}`); |
| 892 | } |
| 893 | return tlsFileContent; |
| 894 | } |
| 895 | |
| 896 | // Load TLS file or array of files |
| 897 | // if tlsFilename is a string, result will be a Buffer containing the file content |
no outgoing calls
no test coverage detected