Skip to content

Help with loading self-signed CA root certificate #126

@lazytiger

Description

@lazytiger

I have a self-signed root CA using openssl as the following

openssl genrsa -out ca.key 2048
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt

I am trying to load the certificate using rust as the following

 ///self.ca_key and self.ca_crt are the content of the pem file
 let key = KeyPair::from_pem(self.ca_key.as_str())?;
 let mut params = CertificateParams::from_ca_cert_pem(self.ca_crt.as_str(), key)?;

When this code was executed, CouldNotParseKeyPair error was thrown. How can I fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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