| 169 | } |
| 170 | |
| 171 | std::string TLSConfig::getCertificatePathSync() const { |
| 172 | if (tlsCertPath.size()) { |
| 173 | return tlsCertPath; |
| 174 | } |
| 175 | |
| 176 | std::string envCertPath; |
| 177 | if (platform::getEnvironmentVar("FDB_TLS_CERTIFICATE_FILE", envCertPath)) { |
| 178 | return envCertPath; |
| 179 | } |
| 180 | |
| 181 | const char* defaultCertFileName = "fdb.pem"; |
| 182 | if (fileExists(defaultCertFileName)) { |
| 183 | return defaultCertFileName; |
| 184 | } |
| 185 | |
| 186 | if (fileExists(joinPath(platform::getDefaultConfigPath(), defaultCertFileName))) { |
| 187 | return joinPath(platform::getDefaultConfigPath(), defaultCertFileName); |
| 188 | } |
| 189 | |
| 190 | return std::string(); |
| 191 | } |
| 192 | |
| 193 | std::string TLSConfig::getKeyPathSync() const { |
| 194 | if (tlsKeyPath.size()) { |
no test coverage detected