code: public function isSecure(): bool
      {
          $page = $this->getPageModel();
  
          if (null !== $page) {
              return (bool) $page->loadDetails()->rootUseSSL;
          }
  
          $request = $this->requestStack->getCurrentRequest();
  
          if (null === $request) {
              return false;
          }
  
          return $request->isSecure();
      }
docs: {@inheritdoc}