Skip to content

Commit

Permalink
net/transport/tls: Update cert gen for new rustls-pemfile API
Browse files Browse the repository at this point in the history
  • Loading branch information
parazyd committed Oct 27, 2023
1 parent b61127a commit a41668a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/net/transport/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,9 @@ impl TlsUpgrade {
// On each instantiation, generate a new keypair and certificate.
let keypair = ed25519_compact::KeyPair::generate();
let keypair_pem = keypair.to_pem();
let secret_key = pkcs8_private_keys(&mut keypair_pem.as_bytes()).unwrap();
let secret_key = rustls::PrivateKey(secret_key[0].clone());
let mut binding = keypair_pem.as_bytes();
let secret_key = pkcs8_private_keys(&mut binding).next().unwrap().unwrap();
let secret_key = rustls::PrivateKey(secret_key.secret_pkcs8_der().to_vec());

let altnames = vec![base32::encode(false, keypair.pk.as_slice())];

Expand Down

0 comments on commit a41668a

Please sign in to comment.