Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shelldandy/create-cert-files
Create self signed cert files to be used with webpack-dev-server or browsersync
https://github.com/shelldandy/create-cert-files
javascript nodejs ssl-certificates webpack
Last synced: about 2 months ago
JSON representation
Create self signed cert files to be used with webpack-dev-server or browsersync
- Host: GitHub
- URL: https://github.com/shelldandy/create-cert-files
- Owner: shelldandy
- License: mit
- Created: 2017-12-16T19:28:16.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-18T17:44:13.000Z (over 6 years ago)
- Last Synced: 2024-07-05T06:02:59.620Z (3 months ago)
- Topics: javascript, nodejs, ssl-certificates, webpack
- Language: JavaScript
- Size: 9.77 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# create-cert-files
Create self signed cert files to be used with webpack-dev-server or browsersync## Usage with BrowserSync
```bash
npm install --dev create-cert-files browser-sync
``````js
const fakeCert = require('create-cert-files')()
const browserSync = require('browser-sync')browserSync.init({
https: {
key: fakeCert.key,
cert: fakeCert.cert
}
})
```## Usage with webpack
```bash
npm install --save-dev create-cert-files
```In your webpack.config.js
```js
const fakeCert = require('create-cert-files')(options)
const fs = require('fs')module.exports = {
devServer: {
https: {
key: fs.readFileSync(fakeCert.key),
cert: fs.readFileSync(fakeCert.cert)
}
}
}
```## options
### keyPath
Path of key file
### certPath
Path of cert file
### altNames
An array of subjectAltName
```js
[
{
// type 2 is DNS
type: 2,
value: 'localhost'
},
{
// type 7 is IP
type: 7,
ip: '127.0.0.1'
}
]
```* Profit