Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while trying HTTPS support for development --experimental-https #55891

Closed
1 task done
aayman997 opened this issue Sep 23, 2023 · 4 comments · Fixed by #55947
Closed
1 task done

Error while trying HTTPS support for development --experimental-https #55891

aayman997 opened this issue Sep 23, 2023 · 4 comments · Fixed by #55947
Labels
bug Issue was opened via the bug report template. locked

Comments

@aayman997
Copy link
Contributor

aayman997 commented Sep 23, 2023

Link to the code that reproduces this issue

https://github.com/aayman997/test-https

To Reproduce

  1. Create a new Next.js project with version 13.5.0 or above
  2. Edit dev script to be "dev": "next dev --experimental-https"
  3. Run the development server

Current vs. Expected behavior

Current behavior:
An error occurred while generating a self-signed certificate and the server started with HTTP

Expected behavior:
the self-signed certificate should be created usually and the server run with HTTPS

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: Windows 11 Pro
  Arch: x64
  Version: 22H2
Binaries:
  Node: 18.18.0
  npm: 9.8.1
Relevant Packages:
  next: 13.5.2
  react: 18.2.0
  react-dom: 18.2.0

Which area(s) are affected? (Select all that apply)

Not sure

Additional context

No response

@aayman997 aayman997 added the bug Issue was opened via the bug report template. label Sep 23, 2023
@aayman997
Copy link
Contributor Author

error message
image
`> my-app@0.1.0 dev

next dev --experimental-https

⚠ Self-signed certificates are currently an experimental feature, use at your own risk.
Attempting to generate self signed certificate. This may prompt for your password
⨯ Failed to generate self-signed certificate. Falling back to http. Error: Command failed: C:\Users\ahayman\AppData\Local\mkcert\mkcert-v1.4.4-windows-amd64.exe -install -key-file C:
Users\ahayman\test cer\my-app\certificates\localhost-key.pem -cert-file C:\Users\ahayman\test cer\my-app\certificates\localhost.pem localhost 127.0.0.1 ::1
at checkExecSyncError (node:child_process:885:11)
at execSync (node:child_process:957:15)
at createSelfSignedCertificate (C:\Users\ahayman\test cer\my-app\node_modules\next\dist\lib\mkcert.js:123:37)
at async runDevServer (C:\Users\ahayman\test cer\my-app\node_modules\next\dist\cli\next-dev.js:282:35)
at async C:\Users\ahayman\test cer\my-app\node_modules\next\dist\cli\next-dev.js:298:9
at async Span.traceAsyncFn (C:\Users\ahayman\test cer\my-app\node_modules\next\dist\trace\trace.js:105:20)
at async nextDev (C:\Users\ahayman\test cer\my-app\node_modules\next\dist\cli\next-dev.js:297:5)
at async main (C:\Users\ahayman\test cer\my-app\node_modules\next\dist\bin\next:156:5) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 33308,
stdout: null,
stderr: null
}
⚠ Port 3000 is in use, trying 3001 instead.
⚠ Port 3001 is in use, trying 3002 instead.
▲ Next.js 13.5.2

✓ Ready in 3.1s
`

aayman997 pushed a commit to aayman997/next.js that referenced this issue Sep 25, 2023
@aayman997
Copy link
Contributor Author

Issue reproduced and fixed in PR
summary there was an error while generating self-signed certificate if there is a folder name that has a space

@kodiakhq kodiakhq bot closed this as completed in #55947 Sep 25, 2023
kodiakhq bot pushed a commit that referenced this issue Sep 25, 2023
- Related issues linked using fixes #55891

Wrap binaryPath, keyPath, certPath with double quotes
this with casing an error if there is a directory name has a space for ex. folder with name **test https**
@joacub
Copy link

joacub commented Sep 25, 2023

#55971

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants