Skip to content

Commit

Permalink
fix typo challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn committed Oct 22, 2024
1 parent 7518f44 commit 05684e6
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async fn main() {
let listener = TcpListener::new("0.0.0.0:443")
.acme()
.add_domain("test.salvo.rs") // Replace this domain name with your own.
.http01_challege(&mut router).quinn("0.0.0.0:443");
.http01_challenge(&mut router).quinn("0.0.0.0:443");
let acceptor = listener.join(TcpListener::new("0.0.0.0:80")).bind().await;
Server::new(acceptor).serve(router).await;
}
Expand Down
2 changes: 1 addition & 1 deletion README.osc.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async fn main() {
let listener = TcpListener::new("0.0.0.0:443")
.acme()
.add_domain("test.salvo.rs") // 用你自己的域名替换此域名.
.http01_challege(&mut router).quinn("0.0.0.0:443");
.http01_challenge(&mut router).quinn("0.0.0.0:443");
let acceptor = listener.join(TcpListener::new("0.0.0.0:80")).bind().await;
Server::new(acceptor).serve(router).await;
}
Expand Down
2 changes: 1 addition & 1 deletion README.zh-hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async fn main() {
let listener = TcpListener::new("0.0.0.0:443")
.acme()
.add_domain("test.salvo.rs") // 用你自己的域名替换此域名.
.http01_challege(&mut router).quinn("0.0.0.0:443");
.http01_challenge(&mut router).quinn("0.0.0.0:443");
let acceptor = listener.join(TcpListener::new("0.0.0.0:80")).bind().await;
Server::new(acceptor).serve(router).await;
}
Expand Down
2 changes: 1 addition & 1 deletion README.zh-hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async fn main() {
let listener = TcpListener::new("0.0.0.0:443")
.acme()
.add_domain("test.salvo.rs") // 用你自己的域名替换此域名.
.http01_challege(&mut router).quinn("0.0.0.0:443");
.http01_challenge(&mut router).quinn("0.0.0.0:443");
let acceptor = listener.join(TcpListener::new("0.0.0.0:80")).bind().await;
Server::new(acceptor).serve(router).await;
}
Expand Down
6 changes: 3 additions & 3 deletions crates/core/src/conn/acme/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl AcmeConfigBuilder {

/// Sets the challenge type Http01
#[inline]
pub fn http01_challege(self) -> Self {
pub fn http01_challenge(self) -> Self {
Self {
challenge_type: ChallengeType::Http01,
keys_for_http01: Some(Default::default()),
Expand All @@ -120,7 +120,7 @@ impl AcmeConfigBuilder {
}
/// Sets the challenge type TlsAlpn01
#[inline]
pub fn tls_alpn01_challege(self) -> Self {
pub fn tls_alpn01_challenge(self) -> Self {
Self {
challenge_type: ChallengeType::TlsAlpn01,
keys_for_http01: None,
Expand Down Expand Up @@ -193,7 +193,7 @@ mod tests {
.directory("test_directory", "https://test-directory-url.com")
.domains(domains.clone())
.contacts(contacts.clone())
.http01_challege()
.http01_challenge()
.cache_path("test_cache_path")
.before_expired(Duration::from_secs(24 * 60 * 60))
.build()
Expand Down
8 changes: 4 additions & 4 deletions crates/core/src/conn/acme/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ impl<T> AcmeListener<T> {
}

/// Create an handler for HTTP-01 challenge
pub fn http01_challege(self, router: &mut Router) -> Self {
let config_builder = self.config_builder.http01_challege();
pub fn http01_challenge(self, router: &mut Router) -> Self {
let config_builder = self.config_builder.http01_challenge();
if let Some(keys_for_http01) = &config_builder.keys_for_http01 {
let handler = Http01Handler {
keys: keys_for_http01.clone(),
Expand All @@ -111,9 +111,9 @@ impl<T> AcmeListener<T> {
}
/// Create an handler for HTTP-01 challenge
#[inline]
pub fn tls_alpn01_challege(self) -> Self {
pub fn tls_alpn01_challenge(self) -> Self {
Self {
config_builder: self.config_builder.tls_alpn01_challege(),
config_builder: self.config_builder.tls_alpn01_challenge(),
..self
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/conn/acme/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//! // .directory("letsencrypt", salvo::conn::acme::LETS_ENCRYPT_STAGING)
//! .cache_path("acme/letsencrypt")
//! .add_domain("acme-http01.salvo.rs")
//! .http01_challege(&mut router);
//! .http01_challenge(&mut router);
//! let acceptor = listener.join(TcpListener::new("0.0.0.0:80")).bind().await;
//! Server::new(acceptor).serve(router).await;
//! }
Expand Down
2 changes: 1 addition & 1 deletion examples/acme-http01-quinn/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() {
.acme()
.cache_path("temp/letsencrypt")
.add_domain("test.salvo.rs") // Replace this domain name with your own.
.http01_challege(&mut router)
.http01_challenge(&mut router)
.quinn("0.0.0.0:443");
let acceptor = listener.join(TcpListener::new("0.0.0.0:80")).bind().await;
Server::new(acceptor).serve(router).await;
Expand Down
2 changes: 1 addition & 1 deletion examples/acme-http01/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async fn main() {
// .directory("letsencrypt", salvo::conn::acme::LETS_ENCRYPT_STAGING)
.cache_path("/temp/letsencrypt")
.add_domain("test.salvo.rs") // Replace this domain name with your own.
.http01_challege(&mut router);
.http01_challenge(&mut router);
let acceptor = listener.join(TcpListener::new("0.0.0.0:80")).bind().await;
Server::new(acceptor).serve(router).await;
}
2 changes: 1 addition & 1 deletion examples/webtransport-acme-http01/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async fn main() {
.acme()
.cache_path("temp/letsencrypt")
.add_domain("test.salvo.rs")
.http01_challege(&mut router)
.http01_challenge(&mut router)
.quinn("0.0.0.0:443");
let acceptor = listener.join(TcpListener::new("0.0.0.0:80")).bind().await;
Server::new(acceptor).serve(router).await;
Expand Down

0 comments on commit 05684e6

Please sign in to comment.