Class ClientTest


  • public class ClientTest
    extends Object
    A simple client test tool.

    Pass the names of the domains as parameters.

    • Method Detail

      • httpChallenge

        public Challenge httpChallenge​(Authorization auth)
                                throws AcmeException
        Prepares a HTTP challenge.

        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 TokenChallenge.getAuthorization().

        Parameters:
        auth - Authorization to find the challenge in
        Returns:
        Challenge to verify
        Throws:
        AcmeException
      • dnsChallenge

        public Challenge dnsChallenge​(Authorization auth)
                               throws AcmeException
        Prepares a DNS challenge.

        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.

        Parameters:
        auth - Authorization to find the challenge in
        Returns:
        Challenge to verify
        Throws:
        AcmeException
      • acceptChallenge

        public void acceptChallenge​(String message)
                             throws AcmeException
        Presents the instructions for preparing the challenge validation, and waits for dismissal. If the user cancelled the dialog, an exception is thrown.
        Parameters:
        message - Instructions to be shown in the dialog
        Throws:
        AcmeException
      • completeChallenge

        public void completeChallenge​(String message)
                               throws AcmeException
        Presents the instructions for removing the challenge validation, and waits for dismissal.
        Parameters:
        message - Instructions to be shown in the dialog
        Throws:
        AcmeException
      • acceptAgreement

        public void acceptAgreement​(URI agreement)
                             throws AcmeException
        Presents the user a link to the Terms of Service, and asks for confirmation. If the user denies confirmation, an exception is thrown.
        Parameters:
        agreement - URI of the Terms of Service
        Throws:
        AcmeException
      • main

        public static void main​(String... args)
        Invokes this example.
        Parameters:
        args - Domains to get a certificate for