1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-30 17:44:34 +01:00

let's encrypt - wip

This commit is contained in:
jwdeitch 2019-08-07 08:05:16 -04:00
parent e976758d92
commit 2a26c87c36

View File

@ -15,11 +15,15 @@ impl<'a> CertificateRequest<'a> {
let account = directory.account_registration() let account = directory.account_registration()
.email(self.email) .email(self.email)
.register()?; .register()?;
let authorization = account.authorization("example.com")?; let authorization = account.authorization(self.domain)?;
let http_challenge = authorization.get_http_challenge().ok_or("HTTP challenge not found")?;
let http_challenge = authorization.get_http_challenge().ok_or("HTTP challenge failed")?;
http_challenge.save_key_authorization("/var/www")?; http_challenge.save_key_authorization("/var/www")?;
http_challenge.validate()?;
let cert = account.certificate_signer(&[self.domain]).sign_certificate()?;
cert.save_signed_certificate("certificate.pem")?;
cert.save_private_key("certificate.key")?;
Ok(()) Ok(())
} }