Skip to content

When using dev-server https option manifests and paths in CSS files are still http:// instead of https:// #903

@Lustmored

Description

@Lustmored

I have just spent a few hours trying to make dev-server serve files via SSL with .pfx specified (as per Symfony recommendation and personal preference), but I found no way around it. It looks to me like a bug in webpack-dev-server, but am not sure where to look for.

  • Before (encore < 1.0.0)

I had set up in packages.json:

"scripts": {
    "dev-server": "encore dev-server --compress --https --pfx=\"$HOME/.symfony/certs/default.p12\" --disable-host-check",
}
  • After (encore 1.0.x)

Most options were easily migrated to configureDevServerOptions, but:

  • when I set options.https: { pfx: process.env.HOME + '/.symfony/certs/default.p12' } and no --https in command line, dev-server serves files with correct certificate. But manifest.json, entrypoints.json and paths in CSS contains paths with http://, thus development app served via https cannot load any asset.
  • when I set options.https: { pfx: process.env.HOME + '/.symfony/certs/default.p12' } or no options.https at all, but pass --https in command line, dev-server serves files with self signing certificate (ignoring pfx configuration), but creates correct manifest.json, entrypoints.json and paths in CSS.

Second options could be a short term solution for me (accepting new certificate once in a while is not that bad), but it would be nice to have working pfx option with manifest plugin. I see no way to pass pfx in command-line, which could probably solve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBug Fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions