@@ -9,7 +9,7 @@ use tokio_rustls::rustls::{
99} ;
1010use x509_cert:: Certificate ;
1111
12- use super :: WEBHOOK_CERTIFICATE_LIFETIME ;
12+ use super :: { WEBHOOK_CA_LIFETIME , WEBHOOK_CERTIFICATE_LIFETIME } ;
1313
1414type Result < T , E = CertificateResolverError > = std:: result:: Result < T , E > ;
1515
@@ -18,6 +18,9 @@ pub enum CertificateResolverError {
1818 #[ snafu( display( "failed send certificate to channel" ) ) ]
1919 SendCertificateToChannel ,
2020
21+ #[ snafu( display( "failed to generate ECDSA signing key" ) ) ]
22+ GenerateEcdsaSigningKey { source : ecdsa:: Error } ,
23+
2124 #[ snafu( display( "failed to generate new certificate" ) ) ]
2225 GenerateNewCertificate {
2326 #[ snafu( source( from( CertificateResolverError , Box :: new) ) ) ]
@@ -106,8 +109,10 @@ impl CertificateResolver {
106109 tokio:: task:: spawn_blocking ( move || {
107110 let tls_provider = default_provider ( ) ;
108111
112+ let ca_key = ecdsa:: SigningKey :: new ( ) . context ( GenerateEcdsaSigningKeySnafu ) ?;
109113 let mut ca =
110- CertificateAuthority :: new_ecdsa ( ) . context ( CreateCertificateAuthoritySnafu ) ?;
114+ CertificateAuthority :: new_with ( ca_key, rand:: random :: < u64 > ( ) , WEBHOOK_CA_LIFETIME )
115+ . context ( CreateCertificateAuthoritySnafu ) ?;
111116
112117 let certificate = ca
113118 . generate_ecdsa_leaf_certificate (
0 commit comments