| 191 | } |
| 192 | |
| 193 | std::string TLSConfig::getKeyPathSync() const { |
| 194 | if (tlsKeyPath.size()) { |
| 195 | return tlsKeyPath; |
| 196 | } |
| 197 | |
| 198 | std::string envKeyPath; |
| 199 | if (platform::getEnvironmentVar("FDB_TLS_KEY_FILE", envKeyPath)) { |
| 200 | return envKeyPath; |
| 201 | } |
| 202 | |
| 203 | const char* defaultCertFileName = "fdb.pem"; |
| 204 | if (fileExists(defaultCertFileName)) { |
| 205 | return defaultCertFileName; |
| 206 | } |
| 207 | |
| 208 | if (fileExists(joinPath(platform::getDefaultConfigPath(), defaultCertFileName))) { |
| 209 | return joinPath(platform::getDefaultConfigPath(), defaultCertFileName); |
| 210 | } |
| 211 | |
| 212 | return std::string(); |
| 213 | } |
| 214 | |
| 215 | std::string TLSConfig::getCAPathSync() const { |
| 216 | if (tlsCAPath.size()) { |
no test coverage detected