pub fn tls_connector(
        private_key: &PKey<Private>,
        client_cert: &X509,
        trusted_server_cert: &X509,
    ) -> Result<ConnectConfiguration, CreateTlsConnectorError> {
        let mut builder = SslConnector::builder(SslMethod::tls_client())
            .expect("Failed to initialize connector.");
        restrict_tls_version_and_cipher_suites_and_sig_algs(&mut builder);
        ensure_root_self_signed_sigs_verified(&mut builder);
        set_peer_verification_cert_store(vec![trusted_server_cert.clone()], &mut builder)?;
        set_most_restrictive_certificate_verification_depth(&mut builder);
        set_private_key(private_key, client_cert, &mut builder)?;
        set_certificate(client_cert, &mut builder)?;
        check_private_key(client_cert, &mut builder)?;
        let mut connect_config =
            build_connect_configuration(builder, client_cert, trusted_server_cert)?;
        connect_config.set_verify_hostname(false);
        Ok(connect_config)
    }
/// Builds a TLS connector to establish TLS connections on the client side.
///
/// For the exact configuration details, see the documentation of the
/// `TlsHandshake` trait in the `ic-crypto-tls-interfaces` crate.
///
/// # Errors
/// * `CreateTlsConnectorError` if the creation of the connector failed
Builds a TLS connector to establish TLS connections on the client side.
For the exact configuration details, see the documentation of the
`TlsHandshake` trait in the `ic-crypto-tls-interfaces` crate.
Builds a TLS connector to establish TLS connections on the client side . For the exact configuration details see the documentation of the ` TlsHandshake ` trait in the ` ic - crypto - tls - interfaces ` crate .
pub fn tls_connector(
        private_key: &PKey<Private>,
        client_cert: &X509,
        trusted_server_cert: &X509,
    ) -> Result<ConnectConfiguration, CreateTlsConnectorError> {
        let mut builder = SslConnector::builder(SslMethod::tls_client())
            .expect("Failed to initialize connector.");
        restrict_tls_version_and_cipher_suites_and_sig_algs(&mut builder);
        ensure_root_self_signed_sigs_verified(&mut builder);
        set_peer_verification_cert_store(vec![trusted_server_cert.clone()], &mut builder)?;
        set_most_restrictive_certificate_verification_depth(&mut builder);
        set_private_key(private_key, client_cert, &mut builder)?;
        set_certificate(client_cert, &mut builder)?;
        check_private_key(client_cert, &mut builder)?;
        let mut connect_config =
            build_connect_configuration(builder, client_cert, trusted_server_cert)?;
        connect_config.set_verify_hostname(false);
        Ok(connect_config)
    }
pub fn tls_connector ( private_key : & PKey < Private > , client_cert : & X509 , trusted_server_cert : & X509 , ) -> Result < ConnectConfiguration , CreateTlsConnectorError > { let mut builder = SslConnector :: builder ( SslMethod :: tls_client ( ) ) . expect ( " " ) ; restrict_tls_version_and_cipher_suites_and_sig_algs ( & mut builder ) ; ensure_root_self_signed_sigs_verified ( & mut builder ) ; set_peer_verification_cert_store ( vec ! [ trusted_server_cert clone ( ) ] , & mut builder ) ? ; set_most_restrictive_certificate_verification_depth ( & mut builder ) ; set_private_key ( private_key , client_cert , & mut builder ) ? ; set_certificate ( client_cert , & mut builder ) ? ; check_private_key ( client_cert , & mut builder ) ? ; let mut connect_config = build_connect_configuration ( builder , client_cert , trusted_server_cert ) ? ; connect_config . set_verify_hostname ( false ) ; Ok ( connect_config ) }
Builds a TLS connector to establish TLS connections on the client side.
Builds a TLS connector to establish TLS connections on the client side .
private_key
&PKey<Private>
client_cert
&X509
trusted_server_cert
&X509
private_key
&PKey<Private>
client_cert
&X509
trusted_server_cert
&X509
errors
`CreateTlsConnectorError` if the creation of the connector failed
` CreateTlsConnectorError ` if the creation of the connector failed