{"record":{"id":"ebb09114d30102e7","repo":"moghtech/komodo","slug":"invalid-ssl-cert-file-path","errorCode":null,"errorMessage":"Invalid ssl cert file path.","messagePattern":"Invalid ssl cert file path\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"client/core/rs/src/entities/config/periphery.rs","lineNumber":683,"sourceCode":"  fn ssl_enabled(&self) -> bool {\n    self.ssl_enabled\n  }\n  fn ssl_key_file(&self) -> &str {\n    static SSL_KEY_FILE: OnceLock<String> = OnceLock::new();\n    SSL_KEY_FILE.get_or_init(|| {\n      PeripheryConfig::ssl_key_file(self)\n        .into_os_string()\n        .into_string()\n        .expect(\"Invalid ssl key file path.\")\n    })\n  }\n  fn ssl_cert_file(&self) -> &str {\n    static SSL_CERT_FILE: OnceLock<String> = OnceLock::new();\n    SSL_CERT_FILE.get_or_init(|| {\n      PeripheryConfig::ssl_cert_file(self)\n        .into_os_string()\n        .into_string()\n        .expect(\"Invalid ssl cert file path.\")\n    })\n  }\n}\n","sourceCodeStart":665,"sourceCodeEnd":687,"githubUrl":"https://github.com/moghtech/komodo/blob/780ac68b992094a9fccd5fffb760e0c84fd3c3d1/client/core/rs/src/entities/config/periphery.rs#L665-L687","documentation":"In client/core/rs/src/entities/config/periphery.rs ssl_cert_file, the configured SSL certificate path is converted from OsString to String with expect, panicking with 'Invalid ssl cert file path.' if the path is not valid UTF-8. It mirrors the key-file check and indicates the cert path's encoding, not its existence, is the problem.","triggerScenarios":"Starting Periphery with an ssl_cert_file value containing non-UTF-8 bytes (invalid encoding from env vars, filenames, or corrupted config); initialization of the OnceLock on first access to ssl_cert_file().","commonSituations":"Certificate paths with accented/special characters encoded in non-UTF-8 codepages; configs written on Windows then read on Linux; shell env vars with invalid bytes injected into the config.","solutions":["Correct the ssl_cert_file config value to a valid UTF-8 path (rename/move the cert to an ASCII path).","Hexdump the raw config/env value to identify and remove the invalid bytes.","Re-issue or copy the certificate to a standard location like /etc/komodo/ssl/cert.pem and update config.","In code, prefer to_string_lossy or returning a config error instead of expect() to fail gracefully."],"exampleFix":"// before\nssl_cert_file = \"/etc/ssl/café/cert.pem\"  // 'é' stored as Latin-1, not UTF-8\n\n// after\nmkdir -p /etc/komodo/ssl && cp /etc/ssl/*/cert.pem /etc/komodo/ssl/cert.pem\nssl_cert_file = \"/etc/komodo/ssl/cert.pem\"","handlingStrategy":"validation","validationCode":"fn assert_utf8_path(p: &std::path::Path) -> Result<(), String> {\n    p.to_str().map(|_| ()).ok_or_else(|| format!(\"ssl_cert_file path is not valid UTF-8: {:?}\", p))\n}","typeGuard":"fn is_utf8_path(p: &std::ffi::OsStr) -> bool { p.to_str().is_some() }","tryCatchPattern":"// expect() panics; validate at config load instead\nlet cert = config.ssl_cert_file();\nif cert.to_str().is_none() {\n    return Err(format!(\"ssl_cert_file is not valid UTF-8: {:?}\", cert));\n}","preventionTips":["Check cert and key paths together at startup for UTF-8 validity.","Store certificates in ASCII-only paths and verify after copying between systems.","Watch for configs transferred from Windows where non-UTF-8 codepages may encode filenames.","Use to_string_lossy with a warning, or a proper config error, rather than panicking."],"tags":["ssl","tls","config","utf-8","panic","rust"],"backgroundTag":"invalid-config-value","analyzedSha":"780ac68b992094a9fccd5fffb760e0c84fd3c3d1","analyzedAt":"2026-09-08T10:02:44.861Z","contentChangedAt":"2026-09-08T10:02:44.861Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}