Skip to content

Finishing TODO in pingora-core rustls listeners to avoid panicking #927

Description

@omavashia2005

/// Todo: Return a result instead of panicking XD
pub fn build(self) -> Acceptor {
// rustls 0.23+ requires an explicit CryptoProvider.
pingora_rustls::install_default_crypto_provider();
let Ok(Some((certs, key))) = load_certs_and_key_files(&self.cert_path, &self.key_path)
else {
panic!(
"Failed to load provided certificates \"{}\" or key \"{}\".",
self.cert_path, self.key_path
)
};

Wrapping this in a Result might solve this? PR incoming soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions