Skip to content

Commit

Permalink
build: upgrade ACME4j
Browse files Browse the repository at this point in the history
  • Loading branch information
NiccoMlt committed Oct 19, 2024
1 parent 7fff4b2 commit 110180e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 24 deletions.
11 changes: 0 additions & 11 deletions carapace-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.shredzone.acme4j</groupId>
<artifactId>acme4j-utils</artifactId>
<version>${libs.acme4j}</version>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ public class ACMEClient {
private final boolean testingModeOn;
private final KeyPair userKey;

public enum ChallengeType {
HTTP
}

public ACMEClient(KeyPair userKey, boolean testingMode) {
Security.addProvider(new BouncyCastleProvider());
this.userKey = userKey;
Expand Down Expand Up @@ -140,10 +136,9 @@ public Map<String, Challenge> getChallengesForOrder(Order order) throws AcmeExce
* @return {@link Http01Challenge} to verify
*/
private Http01Challenge httpChallenge(Authorization auth) throws AcmeException {
Http01Challenge challenge = auth.findChallenge(Http01Challenge.TYPE);
if (challenge == null) {
throw new AcmeException("Found no " + Http01Challenge.TYPE + " challenge, don't know what to do...");
}
Http01Challenge challenge = auth.findChallenge(Http01Challenge.TYPE)
.map(Http01Challenge.class::cast)
.orElseThrow(() -> new AcmeException("Found no " + Http01Challenge.TYPE + " challenge, don't know what to do..."));
LOG.debug("It must be reachable at: http://{}/.well-known/acme-challenge/{}",
auth.getIdentifier().getDomain(), challenge.getToken()
);
Expand All @@ -161,10 +156,10 @@ private Http01Challenge httpChallenge(Authorization auth) throws AcmeException {
* @throws org.shredzone.acme4j.exception.AcmeException
*/
public Challenge dnsChallenge(Authorization auth) throws AcmeException {
Dns01Challenge challenge = auth.findChallenge(Dns01Challenge.TYPE);
if (challenge == null) {
throw new AcmeException("Found no " + Dns01Challenge.TYPE + " challenge, don't know what to do...");
}
Dns01Challenge challenge = auth
.findChallenge(Dns01Challenge.TYPE)
.map(Dns01Challenge.class::cast)
.orElseThrow(() -> new AcmeException("Found no " + Dns01Challenge.TYPE + " challenge, don't know what to do..."));
LOG.info("DNS-challenge _acme-challenge.{}. to save as TXT-record with content {}", auth.getIdentifier().getDomain(), challenge.getDigest());
return challenge;
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

<libs.projectreactor>2023.0.11</libs.projectreactor>
<libs.netty>4.1.114.Final</libs.netty>
<libs.acme4j>2.12</libs.acme4j>
<libs.acme4j>3.4.0</libs.acme4j>
<libs.bouncycastle>1.78.1</libs.bouncycastle>
<libs.awssdk>2.17.113</libs.awssdk>
<libs.caffeine>3.0.5</libs.caffeine>
Expand Down

0 comments on commit 110180e

Please sign in to comment.