Class ChallengeController
- java.lang.Object
-
- de.trustable.ca3s.core.web.rest.acme.AcmeController
-
- de.trustable.ca3s.core.web.rest.acme.ChallengeController
-
@RestController @RequestMapping("/acme/{realm}/challenge") public class ChallengeController extends AcmeController
-
-
Field Summary
Fields Modifier and Type Field Description static org.xbill.DNS.NameACME_CHALLENGE_PREFIXstatic StringACME_TLS_1_PROTOCOLstatic StringACME_VALIDATION_OIDOID of theacmeValidationextension.-
Fields inherited from class de.trustable.ca3s.core.web.rest.acme.AcmeController
APPLICATION_JOSE_JSON, APPLICATION_JOSE_JSON_VALUE, APPLICATION_JWS, APPLICATION_JWS_VALUE, APPLICATION_PEM_CERT, APPLICATION_PEM_CERT_CHAIN, APPLICATION_PEM_CERT_CHAIN_VALUE, APPLICATION_PEM_CERT_VALUE, APPLICATION_PEM_FILE, APPLICATION_PEM_FILE_VALUE, APPLICATION_PKCS12, APPLICATION_PKCS12_VALUE, APPLICATION_PKIX_CERT, APPLICATION_PKIX_CERT_VALUE, APPLICATION_PROBLEM_JSON, APPLICATION_X_PEM_CERT_CHAIN, APPLICATION_X_PEM_CERT_CHAIN_VALUE, DEFAULT_NONCE_VALID_DAYS, HEADER_X_CA3S_FORWARDED_HOST, HEADER_X_CA3S_PROXY_ID, HEADER_X_JWS_SIGNATURE, NO_DETAIL, NO_INSTANCE, REPLAY_NONCE_HEADER
-
-
Constructor Summary
Constructors Constructor Description ChallengeController(AcmeChallengeRepository challengeRepository, PreferenceUtil preferenceUtil, AuditService auditService, int[] alpnPorts, String resolverHost, int resolverPort, AcmeOrderUtil acmeOrderUtil, int rateSec, int rateMin, int rateHour)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckChallenge(AcmeChallenge challengeDao)org.springframework.http.ResponseEntity<Void>checkChallengeValidation(AcmeChallengeValidation acmeChallengeValidation)org.springframework.http.ResponseEntity<?>getChallenge(long challengeId, String realm, String forwardedHost)booleanisChallengeSolved(AcmeChallenge challengeDao)org.springframework.http.ResponseEntity<?>postChallenge(String requestBody, long challengeId, String realm, String forwardedHost)static booleanvalidateALPNCertificate(AcmeChallenge challengeDao, String host, int port, X509Certificate cert)-
Methods inherited from class de.trustable.ca3s.core.web.rest.acme.AcmeController
accountResourceUriBuilderFrom, authorizationResourceUriBuilderFrom, buildNonceHeader, buildProblemResponseEntity, buildUrlFrom, certificateResourceUriBuilderFrom, challengeResourceUriBuilderFrom, checkACMERateLimit, checkNonce, directoryResourceUriBuilderFrom, generateId, getBase64UrlEncodedRandom, getNewNonce, getPipelineForRealm, getRandomChallenge, keyChangeResourceUriBuilderFrom, locationUriOfAuth, locationUriOfCertificate, locationUriOfOrder, locationUriOfOrderFinalize, newAccountResourceUriBuilderFrom, newAuthorizationResourceUriBuilderFrom, newNonceResourceUriBuilderFrom, newOrderResourceUriBuilderFrom, orderResourceUriBuilderFrom, revokeResourceUriBuilderFrom, updateAccountContactFromRequest, updateAccountFromRequest
-
-
-
-
Field Detail
-
ACME_CHALLENGE_PREFIX
public static final org.xbill.DNS.Name ACME_CHALLENGE_PREFIX
-
ACME_VALIDATION_OID
public static final String ACME_VALIDATION_OID
OID of theacmeValidationextension.- See Also:
- Constant Field Values
-
ACME_TLS_1_PROTOCOL
public static final String ACME_TLS_1_PROTOCOL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ChallengeController
public ChallengeController(AcmeChallengeRepository challengeRepository, PreferenceUtil preferenceUtil, AuditService auditService, @Value("${ca3s.acme.alpn.ports:443}") int[] alpnPorts, @Value("${ca3s.dns.server:}") String resolverHost, @Value("${ca3s.dns.port:53}") int resolverPort, AcmeOrderUtil acmeOrderUtil, @Value("${ca3s.acme.ratelimit.second:0}") int rateSec, @Value("${ca3s.acme.ratelimit.minute:20}") int rateMin, @Value("${ca3s.acme.ratelimit.hour:0}") int rateHour) throws UnknownHostException
- Throws:
UnknownHostException
-
-
Method Detail
-
getChallenge
@RequestMapping(value="/{challengeId}", method=GET, produces="application/json") public org.springframework.http.ResponseEntity<?> getChallenge(@PathVariable long challengeId, @PathVariable String realm, @RequestHeader(value="X-CA3S-Forwarded-Host",required=false) String forwardedHost)
-
postChallenge
@RequestMapping(value="/{challengeId}", method=POST, produces="application/json", consumes="application/jose+json") public org.springframework.http.ResponseEntity<?> postChallenge(@RequestBody String requestBody, @PathVariable long challengeId, @PathVariable String realm, @RequestHeader(value="X-CA3S-Forwarded-Host",required=false) String forwardedHost)
-
isChallengeSolved
public boolean isChallengeSolved(AcmeChallenge challengeDao)
-
checkChallenge
public boolean checkChallenge(AcmeChallenge challengeDao)
-
validateALPNCertificate
public static boolean validateALPNCertificate(AcmeChallenge challengeDao, String host, int port, X509Certificate cert) throws CertificateParsingException
- Throws:
CertificateParsingException
-
checkChallengeValidation
public org.springframework.http.ResponseEntity<Void> checkChallengeValidation(AcmeChallengeValidation acmeChallengeValidation)
-
-