Socket
Socket
Sign inDemoInstall

create-cert-files

Package Overview
Dependencies
27
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

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


Version published
Maintainers
1
Created

Readme

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

Last updated on 18 Apr 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc