tls_api/
error.rs

1// Error
2
3use crate::TlsAcceptorType;
4
5/// Some error types used by tls-api implementations.
6#[derive(Debug, thiserror::Error)]
7pub(crate) enum CommonError {
8    /// TlsBuilder cannot be constructed from PKCS #12 or DER key.
9    #[error(
10        "implementation {} does not support construction from neither DER nor PKCS #12 keys",
11        _0
12    )]
13    TlsBuilderFromFromDerOrPkcs12NotSupported(&'static dyn TlsAcceptorType),
14    #[error("openssl command to convert certificate failed")]
15    OpensslCommandFailedToConvert,
16    #[error("PEM file created from PKCS #12 is expected to contain a single certificate and key, it actually contains {:?}", _0)]
17    PemFromPkcs12ContainsNotSingleCertKeyPair(Vec<String>),
18}