Rename nwe to mozilla_intermediate
This commit is contained in:
parent
43b430e5b0
commit
7d13176cd1
|
|
@ -103,11 +103,11 @@ impl ServerConnectorBuilder {
|
||||||
///
|
///
|
||||||
/// The default configuration is based off of the intermediate profile of Mozilla's server side
|
/// The default configuration is based off of the intermediate profile of Mozilla's server side
|
||||||
/// TLS configuration recommendations, and is subject to change.
|
/// TLS configuration recommendations, and is subject to change.
|
||||||
pub fn new<I>(method: SslMethod,
|
pub fn mozilla_intermediate<I>(method: SslMethod,
|
||||||
private_key: &PKeyRef,
|
private_key: &PKeyRef,
|
||||||
certificate: &X509Ref,
|
certificate: &X509Ref,
|
||||||
chain: I)
|
chain: I)
|
||||||
-> Result<ServerConnectorBuilder, ErrorStack>
|
-> Result<ServerConnectorBuilder, ErrorStack>
|
||||||
where I: IntoIterator,
|
where I: IntoIterator,
|
||||||
I::Item: AsRef<X509Ref>
|
I::Item: AsRef<X509Ref>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,8 @@
|
||||||
//! let pkcs12 = Pkcs12::from_der(&pkcs12).unwrap();
|
//! let pkcs12 = Pkcs12::from_der(&pkcs12).unwrap();
|
||||||
//! let identity = pkcs12.parse("password123").unwrap();
|
//! let identity = pkcs12.parse("password123").unwrap();
|
||||||
//!
|
//!
|
||||||
//! let connector = ServerConnectorBuilder::new(SslMethod::tls(),
|
//! let connector = ServerConnectorBuilder::mozilla_intermediate(
|
||||||
//! &identity.pkey,
|
//! SslMethod::tls(), &identity.pkey, &identity.cert, &identity.chain)
|
||||||
//! &identity.cert,
|
|
||||||
//! &identity.chain)
|
|
||||||
//! .unwrap()
|
//! .unwrap()
|
||||||
//! .build();
|
//! .build();
|
||||||
//! let connector = Arc::new(connector);
|
//! let connector = Arc::new(connector);
|
||||||
|
|
|
||||||
|
|
@ -1112,7 +1112,8 @@ fn connector_client_server() {
|
||||||
let t = thread::spawn(move || {
|
let t = thread::spawn(move || {
|
||||||
let key = PKey::private_key_from_pem(KEY).unwrap();
|
let key = PKey::private_key_from_pem(KEY).unwrap();
|
||||||
let cert = X509::from_pem(CERT).unwrap();
|
let cert = X509::from_pem(CERT).unwrap();
|
||||||
let connector = ServerConnectorBuilder::new(SslMethod::tls(), &key, &cert, None::<X509>)
|
let connector = ServerConnectorBuilder::mozilla_intermediate(
|
||||||
|
SslMethod::tls(), &key, &cert, None::<X509>)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.build();
|
.build();
|
||||||
let stream = listener.accept().unwrap().0;
|
let stream = listener.accept().unwrap().0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue