Skip to content

Commit

Permalink
fix breaking rustls-webpki change with DnsNameRef
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Wrock <[email protected]>
  • Loading branch information
mwrock committed Dec 7, 2023
1 parent b07827c commit 6f35c6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/core/src/tls/ctl_gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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<Path>)
-> 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,
Expand Down

0 comments on commit 6f35c6c

Please sign in to comment.