You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@rsbuild/plugin-basic-ssl

Package Overview
Dependencies
Maintainers
3
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rsbuild/plugin-basic-ssl

Generate an untrusted, self-signed certificate for the HTTPS server.

1.1.1
latest
Source
npmnpm
Version published
Weekly downloads
12K
10.92%
Maintainers
3
Weekly downloads
 
Created
Source

@rsbuild/plugin-basic-ssl

Generate an untrusted, self-signed certificate for the HTTPS server.

The Basic SSL plugin will automatically generate a self-signed certificate and set the server.https option. When you visit the page, your browser will indicate that the certificate is not trusted. You can access the HTTPS page after manually confirming this.

npm version license

Usage

Install:

npm add @rsbuild/plugin-basic-ssl -D

Add plugin to your rsbuild.config.ts:

// rsbuild.config.ts
import { pluginBasicSsl } from "@rsbuild/plugin-basic-ssl";

export default {
  plugins: [pluginBasicSsl()],
};

Then visit the https URL of the page, and confirm in your browser.

Options

If you need to customize the compilation behavior of Sass, you can use the following configs.

filename

Filename of the generated certificate.

  • Type: string
  • Default: 'fake-cert.pem'
  • Example:
pluginBasicSsl({
  filename: "foo.pem",
});

outputPath

Output path of the generated certificate.

  • Type: string
  • Default: __dirname
  • Example:
import path from "node:path";

pluginBasicSsl({
  outputPath: path.join(__dirname, "node_modules/.cache/cert"),
});

selfsignedAttrs

Attributes passing to selfsigned, see selfsigned for details.

  • Type: CertificateField[]
  • Default:
const defaultAttrs = [{ name: "commonName", value: "localhost" }];
  • Example:
pluginBasicSsl({
  selfsignedAttrs: [{ name: "commonName", value: "example.com" }],
});

selfsignedOptions

Options passing to selfsigned, see selfsigned - Options for details.

  • Type: SelfsignedOptions
  • Default:
const defaultOptions = {
  days: 30,
  keySize: 2048,
};
  • Example:
pluginBasicSsl({
  selfsignedOptions: {
    days: 100,
  },
});

License

MIT.

FAQs

Package last updated on 07 Aug 2024

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