moghtech/komodo · critical

Invalid ssl cert file path.

Error message

Invalid ssl cert file path.

What it means

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.

Solutions

  1. Correct the ssl_cert_file config value to a valid UTF-8 path (rename/move the cert to an ASCII path).
  2. Hexdump the raw config/env value to identify and remove the invalid bytes.
  3. Re-issue or copy the certificate to a standard location like /etc/komodo/ssl/cert.pem and update config.
  4. In code, prefer to_string_lossy or returning a config error instead of expect() to fail gracefully.

Example fix

// before
ssl_cert_file = "/etc/ssl/café/cert.pem"  // 'é' stored as Latin-1, not UTF-8

// after
mkdir -p /etc/komodo/ssl && cp /etc/ssl/*/cert.pem /etc/komodo/ssl/cert.pem
ssl_cert_file = "/etc/komodo/ssl/cert.pem"
Defensive patterns

Strategy: validation

Validate before calling

fn assert_utf8_path(p: &std::path::Path) -> Result<(), String> {
    p.to_str().map(|_| ()).ok_or_else(|| format!("ssl_cert_file path is not valid UTF-8: {:?}", p))
}

Type guard

fn is_utf8_path(p: &std::ffi::OsStr) -> bool { p.to_str().is_some() }

Try / catch

// expect() panics; validate at config load instead
let cert = config.ssl_cert_file();
if cert.to_str().is_none() {
    return Err(format!("ssl_cert_file is not valid UTF-8: {:?}", cert));
}

Prevention

When it happens

Trigger: 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().

Common situations: 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.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of moghtech/komodo@780ac68b99 (2026-09-08). Data as JSON: /api/errors/ebb09114d30102e7. Report an issue: GitHub.

Appendix: source

Thrown at client/core/rs/src/entities/config/periphery.rs:683

  fn ssl_enabled(&self) -> bool {
    self.ssl_enabled
  }
  fn ssl_key_file(&self) -> &str {
    static SSL_KEY_FILE: OnceLock<String> = OnceLock::new();
    SSL_KEY_FILE.get_or_init(|| {
      PeripheryConfig::ssl_key_file(self)
        .into_os_string()
        .into_string()
        .expect("Invalid ssl key file path.")
    })
  }
  fn ssl_cert_file(&self) -> &str {
    static SSL_CERT_FILE: OnceLock<String> = OnceLock::new();
    SSL_CERT_FILE.get_or_init(|| {
      PeripheryConfig::ssl_cert_file(self)
        .into_os_string()
        .into_string()
        .expect("Invalid ssl cert file path.")
    })
  }
}

View on GitHub (pinned to 780ac68b99)