HTTPS Dev server with Cordova



  • Chrome requires an https domain to access the media APIs.

    The last comment of this post:
    https://github.com/quasarframework/quasar/issues/701
    Seems to indicate that https is now supported.

    I see quasar 0.15.14 has a ‘https’ option in the ‘dev’ section of the quasar.conf.js. However, setting it to ‘true’ doesn’t seem to have any effect after running:
    quasar dev -m cordova -T browser

    Does anyone have any pointers on how to enable https for the dev server?



  • The https option appears to be disabled for cordova and electron builds, commenting out ‘cfg.devServer.https = false’ in <project>/node_modules/quasar-cli/lib/quasar-config.js eveything works:

      if (this.ctx.mode.cordova || this.ctx.mode.electron) {
        // cfg.devServer.https = false
        cfg.devServer.open = false
        cfg.devServer.compress = false
      }


  • Is there any update on this issue? Creating an HTTPS session on the web server for Cordova seems not configurable, and using Cordova plugins like geolocation requires the HTTPS protocol. The workaround of @driedler is indeed working, but it’s not sustainable.



  • could you explain more…
    I have the same problem



  • The Quasar devServer can be started in an HTTPS enviroment setting the https attribute in quasar.conf.js:

    devServer: {
      https: true
     [...]
    }
    

    Unfortunately this setting is ignored when starting the devServer in Cordova or Electron mode, since false is hard-coded in <project>/node_modules/quasar-cli/lib/quasar-config.js line 528:

      else if (this.ctx.mode.cordova || this.ctx.mode.electron) {
        Object.assign(cfg.devServer, {
          https: false,
          open: false
        })
      }
    

    Changing here the https value to true “solves” this issue, but being inside the library it’s not a good way to solve it. We should have the possibility to configure it from the project’s quasar.conf.js.