Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from_pem implemented for Certificate, but TlsConnectorBuilder.identity still required Pkcs12 #77

Closed
theherk opened this issue Mar 1, 2018 · 4 comments

Comments

@theherk
Copy link

theherk commented Mar 1, 2018

What would be the preferred method for supporting an identity given by pem, as well? Is there already a way to do this, that I am overlooking?

@sfackler
Copy link
Owner

sfackler commented Mar 1, 2018

There is not yet. Supporting identities through non-PKCS#8 archives is filed as #27. It's doable, but complex for SChannel, and I haven't had a chance to get it working.

@richardwhiuk
Copy link

This is possible in nativetls 0.1, by explicitly using the OpenSSL backend:

        let mut ssl =
            openssl::ssl::SslConnectorBuilder::new(openssl::ssl::SslMethod::tls()).unwrap();
        // Server authentication
        ssl.set_ca_file(ca_certificate.clone()).unwrap();
        // Client authentication
        ssl.set_private_key_file(client_key.clone(), openssl::x509::X509_FILETYPE_PEM)
            .unwrap();
        ssl.set_certificate_chain_file(client_certificate.clone())
            .unwrap();
        ssl.check_private_key().unwrap();
        let builder: native_tls::TlsConnectorBuilder =
            native_tls::backend::openssl::TlsConnectorBuilderExt::from_openssl(ssl);

@jethrogb
Copy link

Is this resolved?

@sfackler
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants