@nmemonica/utils
v0.0.6
Published
Utilities and Cert Exchange service
Readme
@nmemonica/utils
Certificate Exchange Service (for development) for @nmemonica/snservice
Generates required client and server certificates for mTLS authentication
Serves a download page for the generated client certificates (CA and pkcs12).
Includes other utilities like console color and network information
Service Install and Start
Prerequisites
- A server (device running this service) with
- A client (device with browser viewing Nmemonica)
- Internet access
- Network access to the server
This package will be installed as a dependency, but can be installed independently:
# clone repo
git clone https://github.com/bryanjimenez/nmemonica-utils.git
cd nmemonica-utils
# install dependencies
npm install
# build
npm run build
# run service
node ./dist/esmor as a dependency the certificate exchange service can be ran:
# after being installed as a dependency
node ./node_modules/@nmemonica/utilsGenerating Certificates
During the first time run the service will create server certificates and will prompt user for client certificate password and provide client_id.
# Certificates' default location: ./app/https/selfSignedCA:
$ ls ./app/https/selfSignedCA
client.66866.crt.pem intermediate.crt.pem root.openssl.cnf
client.66866.csr intermediate.csr server.crt.pem
client.66866.key.pem intermediate.key.pem server.csr
client.66866.pfx intermediate.openssl.cnf server.key.pem
client.openssl.66866.cnf root.crt.pem server.openssl.cnf
dh-param.pem root.csr
intermediate.chain.crt.pem root.key.pem1. Install Self Signed CA
service_ip: 127.0.0.1, localhost or your ip.http_port: default is 3000 unless set in snservice.conf.json (conf.cert.http)client_id: provided by the utils cli on initial run (or after running with --service)
Chrome Desktop
- Navigate to chrome:settings/certificates
- Authorities tab
- Import (./app/https/selfSignedCA/intermediate.crt.pem)
Mobile
- Navigate to http://
service_ip:http_port/ - Click Download button under Certificate Authority
- Install intermediate.crt.pem from browser.
- Name your CA (optional).
2. Install Client Certificate
Chrome Desktop
- Your certificates tab
- Click Import (./app/https/selfSignedCA/client.
client_id.crt.pem)
Mobile
- After installing CA on the same page.
- Input
client_idin client id field. - Press Download or hit enter.
- Open and extract certificate using password provided for
client_id. - Name your client certificate (optional).
Configuration file
Configurations will be set from snservice.conf.json which should be located at the project's root directory.
// snservice.conf.json
{
cert: {
port: {
http: /*number;*/ 3000, // default
https: /*number;*/ 3443, // default
};
};
directory: {
ca: /*string;*/ "app/https/selfSignedCA",
};
}