public class ClientTest extends Object
Pass the names of the domains as parameters.
Constructor and Description |
---|
ClientTest() |
Modifier and Type | Method and Description |
---|---|
void |
acceptAgreement(Registration reg,
URI agreement)
Presents the user a link to the Terms of Service, and asks for confirmation.
|
void |
acceptChallenge(String message)
Presents the instructions for preparing the challenge validation, and waits for
dismissal.
|
Challenge |
dnsChallenge(Authorization auth,
String domain)
Prepares a DNS challenge.
|
void |
fetchCertificate(Collection<String> domains)
Generates a certificate for the given domains.
|
Challenge |
httpChallenge(Authorization auth,
String domain)
Prepares a HTTP challenge.
|
static void |
main(String... args)
Invokes this example.
|
public ClientTest()
public void fetchCertificate(Collection<String> domains) throws IOException, AcmeException
domains
- Domains to get a common certificate forIOException
AcmeException
public Challenge httpChallenge(Authorization auth, String domain) throws AcmeException
The verification of this challenge expects a file with a certain content to be reachable at a given path under the domain to be tested.
This example outputs instructions that need to be executed manually. In a
production environment, you would rather generate this file automatically, or maybe
use a servlet that returns Http01Challenge.getAuthorization()
.
auth
- Authorization
to find the challenge indomain
- Domain name to be authorizedChallenge
to verifyAcmeException
public Challenge dnsChallenge(Authorization auth, String domain) throws AcmeException
The verification of this challenge expects a TXT record with a certain content.
This example outputs instructions that need to be executed manually. In a production environment, you would rather configure your DNS automatically.
auth
- Authorization
to find the challenge indomain
- Domain name to be authorizedChallenge
to verifyAcmeException
public void acceptChallenge(String message) throws AcmeException
message
- Instructions to be shown in the dialogAcmeException
public void acceptAgreement(Registration reg, URI agreement) throws AcmeException
reg
- Registration
User's registrationagreement
- URI
of the Terms of ServiceAcmeException
Copyright © 2015–2019. All rights reserved.