Function generateCACertificate

  • Generate a CA certificate for mocking HTTPS.

    Returns a promise, for an object with key and cert properties, containing the generated private key and certificate in PEM format.

    These can be saved to disk, and their paths passed as HTTPS options to a Mockttp server.

    Parameters

    • options: {
          bits?: number;
          commonName?: string;
          countryName?: string;
          nameConstraints?: {
              permitted?: string[];
          };
          organizationName?: string;
      } = {}
      • Optionalbits?: number
      • OptionalcommonName?: string
      • OptionalcountryName?: string
      • OptionalnameConstraints?: {
            permitted?: string[];
        }
        • Optionalpermitted?: string[]
      • OptionalorganizationName?: string

    Returns Promise<{
        cert: string;
        key: string;
    }>