feat(v2): add support for key,cert in https (#3594)

* fix: add support for key,cert in https

* docs: add steps for using https with docusaurus

* improve https certs docs

* typo

* local https: add mkcert -install step

Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
Thakur Karthik 2020-10-26 21:58:12 +05:30 committed by GitHub
parent c91027f2fa
commit 92884431d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 2 deletions

View file

@ -57,6 +57,22 @@ Please note that some functionality (for example, anchor links) will not work in
:::
#### Enabling HTTPS`
There are multiple ways to obtain a certificate. We will use [mkcert](https://github.com/FiloSottile/mkcert) as an example.
1. Run `mkcert localhost` to generate `localhost.pem` + `localhost-key.pem`
2. Run `mkcert -install` to install the cert in your trust store, and restart your browser
3. Start the app with Docusaurus HTTPS env variables:
```shell
HTTPS=true SSL_CRT_FILE=localhost.pem SSL_KEY_FILE=localhost-key.pem yarn start
```
4. Open `https://localhost:3000/`
### `docusaurus build`
Compiles your site for production.