Package io.micronaut.acme
Class AcmeConfiguration
java.lang.Object
io.micronaut.acme.AcmeConfiguration
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
@ConfigurationProperties("acme")
public class AcmeConfiguration
extends Object
implements io.micronaut.core.util.Toggleable
Allows the configuration of the Acme certificate process.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBase class for configuration classes.static classAllows the configuration of the Acme certificate authentication process.static enumDefines the type of valid challenges.static classAllows the configuration of the Acme certificate ordering process. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull @NotBlank @NotNull StringAccount key used to authenticate with the ACME server.@NonNull @NotBlank @NotNull StringGets the acme server to authenticate and order the certificate from.getAuth()Get authentication configuration.@NonNull FileGets the location to save the certificate on disk to.Get the challenge type to be used to validate the account.@NonNull @NotBlank @NotNull StringKey in which to be used to generate the CSR which will be used to order the certificate from the ACME server.Gets the domain(s) in which the certificate will be ordered for.Gets the current http challenge server port.getOrder()Get order configuration.@NonNull DurationGet the duration in which you would like to renew the certificate within.Gets the timeout that has been set when calling an acme server.booleanIf acme certificate background and setup process should be enabled.booleanGet whether or not you agree to the terms of service for ACME services to work.voidsetAccountKey(@NonNull String accountKey) Sets the account key used for authentication.voidsetAcmeServer(@NonNull String acmeServer) Sets the acme server to authenticate and order the certificate from.voidSet authentication configuration.voidsetCertLocation(@NonNull File certLocation) Sets the location to save the certificate on disk to.voidsetChallengeType(AcmeConfiguration.ChallengeType challengeType) Set the challenge type to be used to validate the account.voidsetDomainKey(@NonNull String domainKey) Sets the key string in which to be used to generate the CSR which will be used to order the certificate from the ACME server.voidsetDomains(List<String> domains) Sets the domain(s) in which to order the certificate for.voidsetEnabled(boolean enabled) Sets if acme certificate backgroun and setup process is enabled.voidsetHttpChallengeServerPort(Integer httpChallengeServerPort) Sets the port to start the http challenge server on.voidSet the order configuration.voidsetRenewWitin(@NonNull Duration renewWitin) Sets the duration in which the application will trigger the renew process to get a new certificate.voidsetTimeout(Duration timeout) Sets the timeout for requests made to the acme server.voidsetTosAgree(boolean tosAgree) Sets whether or not you agree to the terms of service.
-
Constructor Details
-
AcmeConfiguration
public AcmeConfiguration()
-
-
Method Details
-
isEnabled
public boolean isEnabled()If acme certificate background and setup process should be enabled.- Specified by:
isEnabledin interfaceio.micronaut.core.util.Toggleable- Returns:
- True if acme certificate process is enabled.
-
setEnabled
public void setEnabled(boolean enabled) Sets if acme certificate backgroun and setup process is enabled. Default true.- Parameters:
enabled- The enablement flag
-
getDomains
Gets the domain(s) in which the certificate will be ordered for. This can be one to many domain names or a wildcard domain.- Returns:
- the domain(s) name configured
-
setDomains
Sets the domain(s) in which to order the certificate for.- Parameters:
domains- the domain(s) name to be requested
-
isTosAgree
public boolean isTosAgree()Get whether or not you agree to the terms of service for ACME services to work.- Returns:
- the terms of service
-
setTosAgree
public void setTosAgree(boolean tosAgree) Sets whether or not you agree to the terms of service.- Parameters:
tosAgree- true/false if you agree to the terms of service
-
getRenewWitin
Get the duration in which you would like to renew the certificate within. Default 30 days.- Returns:
- the renew within duration
-
setRenewWitin
Sets the duration in which the application will trigger the renew process to get a new certificate.- Parameters:
renewWitin- duration before rene process started
-
getOrder
Get order configuration.- Returns:
- order configuration
-
setOrder
Set the order configuration.- Parameters:
order- order configuration
-
getAuth
Get authentication configuration.- Returns:
- auth configuration
-
setAuth
Set authentication configuration.- Parameters:
auth- authentication configuration
-
getAccountKey
Account key used to authenticate with the ACME server.- Returns:
- the account key string
-
setAccountKey
Sets the account key used for authentication.- Parameters:
accountKey- account key string
-
getDomainKey
Key in which to be used to generate the CSR which will be used to order the certificate from the ACME server.- Returns:
- domain key string value
-
setDomainKey
Sets the key string in which to be used to generate the CSR which will be used to order the certificate from the ACME server.- Parameters:
domainKey- key string
-
getCertLocation
Gets the location to save the certificate on disk to.- Returns:
- location to certificate
-
setCertLocation
Sets the location to save the certificate on disk to.- Parameters:
certLocation- location to certificate
-
getAcmeServer
Gets the acme server to authenticate and order the certificate from.- Returns:
- url of the acme server
-
setAcmeServer
Sets the acme server to authenticate and order the certificate from.- Parameters:
acmeServer- url of acme server
-
getChallengeType
Get the challenge type to be used to validate the account. DefaultDEFAULT_CHALLENGE_TYPE.- Returns:
- the challenge type
-
setChallengeType
Set the challenge type to be used to validate the account.- Parameters:
challengeType- challenge type to be used
-
getHttpChallengeServerPort
Gets the current http challenge server port.- Returns:
- http challenge server port
-
setHttpChallengeServerPort
Sets the port to start the http challenge server on.- Parameters:
httpChallengeServerPort- expected http challenge server port
-
getTimeout
Gets the timeout that has been set when calling an acme server. Default- Returns:
- timeout
-
setTimeout
Sets the timeout for requests made to the acme server.- Parameters:
timeout- http request timeout
-