From 6f35c6c2225cd873ccc142de7eaa4f098a9cbadc Mon Sep 17 00:00:00 2001 From: Matt Wrock Date: Thu, 7 Dec 2023 15:05:45 -0800 Subject: [PATCH] fix breaking rustls-webpki change with DnsNameRef Signed-off-by: Matt Wrock --- components/core/src/tls/ctl_gateway.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/core/src/tls/ctl_gateway.rs b/components/core/src/tls/ctl_gateway.rs index 160c8e62671..e7785f749a8 100644 --- a/components/core/src/tls/ctl_gateway.rs +++ b/components/core/src/tls/ctl_gateway.rs @@ -20,7 +20,7 @@ use std::{fs::{self, path::{Path, PathBuf}}; use thiserror::Error; -use webpki::DnsNameRef; +use webpki::types::DnsName; const NAME_PREFIX: &str = "ctl-gateway"; const CRT_EXTENSION: &str = "crt.pem"; @@ -38,11 +38,11 @@ pub enum Error { CertificateWrite(#[from] IoError), } -pub fn generate_self_signed_certificate_and_key(subject_alternate_name: DnsNameRef, +pub fn generate_self_signed_certificate_and_key(subject_alternate_name: DnsName, path: impl AsRef) -> Result<(), Error> { let mut params = - CertificateParams::new(vec![Into::<&str>::into(subject_alternate_name).to_string(), + CertificateParams::new(vec![Into::<&str>::into(subject_alternate_name.as_ref()).to_string(), "localhost".to_string(),]); let mut distinguished_name = DistinguishedName::new(); distinguished_name.push(DnType::OrganizationName,