Skip to content

Commit

Permalink
Update acme4j to v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
porunov committed Apr 23, 2018
1 parent 2f93c20 commit fd45c14
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ targetCompatibility = 1.8

dependencies {
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
compile group: 'org.shredzone.acme4j', name: 'acme4j-client', version: '0.13'
compile group: 'org.shredzone.acme4j', name: 'acme4j-utils', version: '0.13'
compile group: 'org.shredzone.acme4j', name: 'acme4j-client', version: '1.0'
compile group: 'org.shredzone.acme4j', name: 'acme4j-utils', version: '1.0'
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.56'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
compile group: 'com.beust', name: 'jcommander', version: '1.64'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.lang.reflect.Type;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Paths;
import java.time.Instant;
import java.util.HashSet;
Expand Down Expand Up @@ -55,9 +55,9 @@ List<Authorization> getNotExpiredAuthorizations() {

for(String authorizationLocation : authorizationLocationList){
try {
oldAuthorizationList.add(Authorization.bind(getSession(), new URI(authorizationLocation)));
} catch (URISyntaxException e) {
LOG.warn("URI isn't correct: "+authorizationLocation, e);
oldAuthorizationList.add(Authorization.bind(getSession(), new URL(authorizationLocation)));
} catch (MalformedURLException e) {
LOG.warn("URL isn't correct: "+authorizationLocation, e);
} catch (Exception e){
LOG.warn("Cannot retrieve authorization: "+authorizationLocation, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
import com.jblur.acme_client.command.ACMECommand;
import com.jblur.acme_client.command.AccountKeyNotFoundException;
import com.jblur.acme_client.manager.CertificateManager;
import org.shredzone.acme4j.Authorization;
import org.shredzone.acme4j.Certificate;
import org.shredzone.acme4j.exception.AcmeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.lang.reflect.Type;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Paths;
import java.security.cert.CertificateEncodingException;
import java.util.LinkedList;
Expand Down Expand Up @@ -91,9 +90,9 @@ List<Certificate> getNotExpiredCertificates() {

for(String certificateLocation : certificateLocationList){
try {
oldCertificateList.add(Certificate.bind(getSession(), new URI(certificateLocation)));
} catch (URISyntaxException e) {
LOG.warn("URI isn't correct: "+certificateLocation, e);
oldCertificateList.add(Certificate.bind(getSession(), new URL(certificateLocation)));
} catch (MalformedURLException e) {
LOG.warn("URL isn't correct: "+certificateLocation, e);
} catch (Exception e){
LOG.warn("Cannot retrieve certificate: "+certificateLocation, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.shredzone.acme4j.exception.AcmeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.URI;
import java.net.URL;
import java.util.Collection;

public class AuthorizationManager {
Expand All @@ -22,8 +22,8 @@ public AuthorizationManager(Registration registration, String domainName) throws
this.authorization = registration.authorizeDomain(domainName);
}

public AuthorizationManager(Session session, URI authUri) {
this.authorization = Authorization.bind(session, authUri);
public AuthorizationManager(Session session, URL authUrl) {
this.authorization = Authorization.bind(session, authUrl);
}

public AuthorizationManager(Authorization authorization) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.shredzone.acme4j.exception.AcmeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.URI;
import java.net.URL;
import java.security.cert.X509Certificate;

public class CertificateManager {
Expand All @@ -22,8 +22,8 @@ public CertificateManager(byte[] csr, Registration registration) throws AcmeExce
}

//For existing certificate
public CertificateManager(Session session, URI certificateLocationUri) {
this.certificate = Certificate.bind(session, certificateLocationUri);
public CertificateManager(Session session, URL certificateLocationUrl) {
this.certificate = Certificate.bind(session, certificateLocationUrl);
}

public CertificateManager(Certificate certificate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.shredzone.acme4j.exception.AcmeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.URI;
import java.net.URL;
import java.util.concurrent.TimeoutException;

public class ChallengeManager {
Expand Down Expand Up @@ -46,8 +46,8 @@ public ChallengeManager(Authorization authorization, String type, Session sessio
}
}

public ChallengeManager(Session session, URI challengeURI) throws AcmeException {
this.challenge = Challenge.bind(session, challengeURI);
public ChallengeManager(Session session, URL challengeURL) throws AcmeException {
this.challenge = Challenge.bind(session, challengeURL);
}

public Challenge getChallenge() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.URI;
import java.net.URL;
import java.security.KeyPair;

public class RegistrationManager {
Expand Down Expand Up @@ -48,9 +49,9 @@ public RegistrationManager(Session session, String email) throws AcmeException {
}
}

public RegistrationManager(Session session, URI accountLocationUri) {
public RegistrationManager(Session session, URL accountLocationUrl) {
this.session = session;
this.registration = Registration.bind(session, accountLocationUri);
this.registration = Registration.bind(session, accountLocationUrl);
}

public Registration getRegistration() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=Porunov Java ACME Client (PJAC) v2.1.2 rev58
version=Porunov Java ACME Client (PJAC) v2.1.3 rev59

0 comments on commit fd45c14

Please sign in to comment.