mirror of https://github.com/stjepang/smol
Move the certificate into examples directory
This commit is contained in:
parent
a52bdf354f
commit
4a04d23cc4
|
@ -75,7 +75,7 @@ async fn listen(listener: Async<TcpListener>, tls: Option<TlsAcceptor>) -> Resul
|
|||
|
||||
fn main() -> Result<()> {
|
||||
// Initialize TLS with the local certificate, private key, and password.
|
||||
let identity = Identity::from_pkcs12(include_bytes!("../identity.pfx"), "password")?;
|
||||
let identity = Identity::from_pkcs12(include_bytes!("identity.pfx"), "password")?;
|
||||
let tls = TlsAcceptor::from(native_tls::TlsAcceptor::new(identity)?);
|
||||
|
||||
// Create an executor thread pool.
|
||||
|
|
|
@ -55,7 +55,7 @@ async fn listen(listener: Async<TcpListener>, tls: Option<TlsAcceptor>) -> Resul
|
|||
|
||||
fn main() -> Result<()> {
|
||||
// Initialize TLS with the local certificate, private key, and password.
|
||||
let identity = Identity::from_pkcs12(include_bytes!("../identity.pfx"), "password")?;
|
||||
let identity = Identity::from_pkcs12(include_bytes!("identity.pfx"), "password")?;
|
||||
let tls = TlsAcceptor::from(native_tls::TlsAcceptor::new(identity)?);
|
||||
|
||||
// Create an executor thread pool.
|
||||
|
|
|
@ -72,7 +72,7 @@ async fn listen(listener: Async<TcpListener>, tls: Option<TlsAcceptor>) -> Resul
|
|||
|
||||
fn main() -> Result<()> {
|
||||
// Initialize TLS with the local certificate, private key, and password.
|
||||
let identity = Identity::from_pkcs12(include_bytes!("../identity.pfx"), "password")?;
|
||||
let identity = Identity::from_pkcs12(include_bytes!("identity.pfx"), "password")?;
|
||||
let tls = TlsAcceptor::from(native_tls::TlsAcceptor::new(identity)?);
|
||||
|
||||
// Create an executor thread pool.
|
||||
|
|
|
@ -24,7 +24,7 @@ use smol::Async;
|
|||
fn main() -> Result<()> {
|
||||
// Initialize TLS with the local certificate.
|
||||
let mut builder = native_tls::TlsConnector::builder();
|
||||
builder.add_root_certificate(Certificate::from_pem(include_bytes!("../certificate.pem"))?);
|
||||
builder.add_root_certificate(Certificate::from_pem(include_bytes!("certificate.pem"))?);
|
||||
let tls = TlsConnector::from(builder);
|
||||
|
||||
smol::run(async {
|
||||
|
|
|
@ -29,7 +29,7 @@ async fn echo(stream: TlsStream<Async<TcpStream>>) -> Result<()> {
|
|||
|
||||
fn main() -> Result<()> {
|
||||
// Initialize TLS with the local certificate, private key, and password.
|
||||
let identity = Identity::from_pkcs12(include_bytes!("../identity.pfx"), "password")?;
|
||||
let identity = Identity::from_pkcs12(include_bytes!("identity.pfx"), "password")?;
|
||||
let tls = TlsAcceptor::from(native_tls::TlsAcceptor::new(identity)?);
|
||||
|
||||
smol::run(async {
|
||||
|
|
|
@ -53,7 +53,7 @@ async fn connect(addr: &str, tls: TlsConnector) -> Result<(WsStream, Response)>
|
|||
fn main() -> Result<()> {
|
||||
// Initialize TLS with the local certificate.
|
||||
let mut builder = native_tls::TlsConnector::builder();
|
||||
builder.add_root_certificate(Certificate::from_pem(include_bytes!("../certificate.pem"))?);
|
||||
builder.add_root_certificate(Certificate::from_pem(include_bytes!("certificate.pem"))?);
|
||||
let tls = TlsConnector::from(builder);
|
||||
|
||||
smol::run(async {
|
||||
|
|
|
@ -61,7 +61,7 @@ async fn listen(listener: Async<TcpListener>, tls: Option<TlsAcceptor>) -> Resul
|
|||
|
||||
fn main() -> Result<()> {
|
||||
// Initialize TLS with the local certificate, private key, and password.
|
||||
let identity = Identity::from_pkcs12(include_bytes!("../identity.pfx"), "password")?;
|
||||
let identity = Identity::from_pkcs12(include_bytes!("identity.pfx"), "password")?;
|
||||
let tls = TlsAcceptor::from(native_tls::TlsAcceptor::new(identity)?);
|
||||
|
||||
// Create an executor thread pool.
|
||||
|
|
Loading…
Reference in New Issue