🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

create-cert-files

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-cert-files

Create self signed cert files to be used with webpack-dev-server or browsersync

1.1.0
latest
Source
npm
Version published
Weekly downloads
186
-58.85%
Maintainers
1
Weekly downloads
 
Created
Source

create-cert-files

Create self signed cert files to be used with webpack-dev-server or browsersync

Usage with BrowserSync

npm install --dev create-cert-files browser-sync
const fakeCert = require('create-cert-files')()
const browserSync = require('browser-sync')

browserSync.init({
  https: {
    key: fakeCert.key,
    cert: fakeCert.cert
  }
})

Usage with webpack

npm install --save-dev create-cert-files

In your webpack.config.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

[
    {
      // type 2 is DNS
      type: 2,
      value: 'localhost'
    },
    {
      // type 7 is IP
      type: 7,
      ip: '127.0.0.1'
    }
]
  • Profit

FAQs

Package last updated on 18 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts