Class Http01ChallengeController

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller

    public class Http01ChallengeController
    extends BaseController
    Controller for Let's Encrypt HTTP-01 challenge. It is used in cases where global server URL has no port, thus we don't need to open the challenge socket on port 80.
    • Field Summary

      • Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator

        HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST
      • Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChallengeFile​(String challengeFileName, String challengeFileContents)
      Adds new challenge file to serve in /.well-known/acme-challenge/** scope.
      void addChallengeFiles​(Collection<AcmeAuthorization> authorizations)  
      protected org.springframework.web.servlet.ModelAndView doHandle​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Performs actual request processing
      void removeChallengeFile​(String challengeFileName)
      Removes challenge file from controller.
      void removeChallengeFiles​(Collection<AcmeAuthorization> authorizations)  
      • Methods inherited from class org.springframework.web.servlet.mvc.AbstractController

        isSynchronizeOnSession, setSynchronizeOnSession
      • Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator

        applyCacheControl, applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, prepareResponse, preventCaching, setAlwaysMustRevalidate, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader, setVaryByRequestHeaders
      • Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

        getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
      • Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

        getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
    • Constructor Detail

      • Http01ChallengeController

        public Http01ChallengeController​(@NotNull
                                         AuthorizationInterceptor authorizationInterceptor)
    • Method Detail

      • doHandle

        @Nullable
        protected org.springframework.web.servlet.ModelAndView doHandle​(@NotNull
                                                                        javax.servlet.http.HttpServletRequest request,
                                                                        @NotNull
                                                                        javax.servlet.http.HttpServletResponse response)
                                                                 throws Exception
        Description copied from class: BaseController
        Performs actual request processing
        Specified by:
        doHandle in class BaseController
        Parameters:
        request - HTTP request
        response - HTTP response
        Returns:
        model and view components
        Throws:
        Exception - exception
      • addChallengeFile

        public void addChallengeFile​(@NotNull
                                     String challengeFileName,
                                     @NotNull
                                     String challengeFileContents)
        Adds new challenge file to serve in /.well-known/acme-challenge/** scope.
        Parameters:
        challengeFileName - challenge file name
        challengeFileContents - challenge file contents
      • removeChallengeFile

        public void removeChallengeFile​(@NotNull
                                        String challengeFileName)
        Removes challenge file from controller. This method allows cleaning used challenge files.
        Parameters:
        challengeFileName - challenge file name