Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !5845

Add option to provide custom ssl certificates during development

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/alexbrazier/feature/custom-ssl into master Nov 17, 2018
  • Overview 47
  • Commits 15
  • Pipelines 0
  • Changes 3

Created by: alexbrazier

Closes: #4050 (closed) #3603 (closed) #3441 (closed) #1411 (closed)

This PR adds the option to provide a custom SSL certificate and key using the SSL_CRT_FILE and SSL_KEY_FILE env vars.

The webpack dev server already accepts certificates if you provide them, so this just reads the files and passes them in.

As an extra check so there is no confusion when an error occurs, it will verify the files exist and that they are valid before passing them into webpack.

You can pass in relative paths ../cert.crt, cert.crt etc, or full paths /Users/test/cert.crt

Testing

  • Tested using yarn start and yarn create-react-app my-app
  • Tested with .env file
  • Tested with exported envs and inline envs
  • Tested without HTTPS flag - (same behaviour as before)
  • Tested with HTTPS flag and without new flags - (same behaviour as before)
  • Tested with invalid path (see error below)
  • Tested with invalid cert and key (see error below)
  • Tested with valid custom cert and verified the dev server was using it

Invalid config errors

Doesn't exist

image

Invalid cert file

image

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/alexbrazier/feature/custom-ssl