Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-62832

mobile check for valid certificate always returns not-trusted

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.4.3, 3.5
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE

      Description

      Code in admin/tool/mobile/classes/api.php | get_potential_config_issues()

       

      $curl->setopt(array('CURLOPT_CERTINFO' => 1, 'CURLOPT_SSL_VERIFYPEER' => true));
       
      $httpswwwroot = str_replace('http:', 'https:', $CFG->wwwroot); // Force https url.
       
      // Check https using a page not redirecting or returning exceptions.
       
      $curl->head($httpswwwroot . "/$CFG->admin/tool/mobile/mobile.webmanifest.php");
      

      The call to $curl->head does not use the options set with $curl->setopt

       

      lib/filelib.php | head()

       

      public function head($url, $options = array()) {
       
      $options['CURLOPT_HTTPGET'] = 0;
       
      $options['CURLOPT_HEADER'] = 1;
       
      $options['CURLOPT_NOBODY'] = 1;
       
      return $this->request($url, $options);
       
      }
      

      Thus when lib/filelib.php | request() is called, only the above 3 options are set which results in the certinfo field always being empty.

      I also tried setting the options (above 2 plus CURLOPT_VERBOSE) in head() with same empty certinfo field result.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: