Compare commits

...

2 Commits

4 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,10 @@
# Changelog
## 2024-09-18 - 5.2.0 - feat(TapNodeTools)
Add ability to create HTTPS certificates with self-signed option
- Introduced a new parameter `allowSelfSigned` to the `createHttpsCert` function.
## 2024-09-18 - 5.1.4 - fix(ts_node)
Fixed issues in HTTPS certificate generation for TapNodeTools

View File

@ -1,7 +1,7 @@
{
"name": "@push.rocks/tapbundle",
"private": false,
"version": "5.1.4",
"version": "5.2.0",
"description": "A test automation library bundling utilities and tools for TAP (Test Anything Protocol) based testing, specifically tailored for tapbuffer.",
"exports": {
".": "./dist_ts/index.js",

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/tapbundle',
version: '5.1.4',
version: '5.2.0',
description: 'A test automation library bundling utilities and tools for TAP (Test Anything Protocol) based testing, specifically tailored for tapbuffer.'
}

View File

@ -16,8 +16,14 @@ class TapNodeTools {
}
public async createHttpsCert(
commonName: string = 'localhost'
commonName: string = 'localhost',
allowSelfSigned: boolean = true
): Promise<{ key: string; cert: string }> {
if (allowSelfSigned) {
// set node to allow self-signed certificates
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
}
// Generate a key pair
const keys = plugins.smartcrypto.nodeForge.pki.rsa.generateKeyPair(2048);