From c5afc0b13fdd16e5c8a679cf30b512b3742392a0 Mon Sep 17 00:00:00 2001 From: Joshua Potts <8704475+iamjpotts@users.noreply.github.com> Date: Thu, 24 Aug 2023 13:35:47 -0500 Subject: [PATCH] Add example of generating a new CA and a new server cert signed by that CA, resolving #79 --- examples/auto-gen-ca-and-server-tls.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/examples/auto-gen-ca-and-server-tls.rs b/examples/auto-gen-ca-and-server-tls.rs index b41851ab..700f4235 100644 --- a/examples/auto-gen-ca-and-server-tls.rs +++ b/examples/auto-gen-ca-and-server-tls.rs @@ -8,23 +8,13 @@ //! This doesn't start a network service (not even on localhost). //! Instead, it creates an in-memory TLS server and an in-memory //! TLS client in two separate threads in the same process. -//! -//! This example has the same author as a similar test in -//! https://github.com/iamjpotts/demo_docker_registry_auto_gen_tls/blob/31c85aa06a87a8dbebc457af9b5998038e2daaa2/tests/test_utils/cert_gen.rs -//! which does not have a license. -//! -//! This example auto-gen-ca-and-server-tls is contributed by -//! the same author into rcgen according to the rcgen license: -//! -//! "MIT or Apache License 2.0, at your option." -//! use std::error::Error; use std::io; use std::thread; use native_tls::{HandshakeError, Identity, TlsAcceptor, TlsConnector, TlsStream}; -use rcgen::{BasicConstraints, CertificateSigningRequest, DnType, IsCa, SanType, ExtendedKeyUsagePurpose, KeyUsagePurpose, DistinguishedName, CertificateParams, Certificate, RcgenError}; +use rcgen::{BasicConstraints, CertificateSigningRequest, DnType, IsCa, SanType, KeyUsagePurpose, DistinguishedName, CertificateParams, Certificate, RcgenError}; const SAN: &str = "example-server"; @@ -133,7 +123,6 @@ fn gen_cert_for_server(ca: &Certificate) -> Result