MCPcopy Create free account
hub / github.com/scality/cloudserver / _loadTlsFile

Method _loadTlsFile

lib/Config.js:875–894  ·  view source on GitHub ↗
(tlsFileName)

Source from the content-addressed store, hash-verified

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

Callers 2

_parseKmipTransportMethod · 0.95
_loadTlsFileArrayMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected