waitingsong / node-myca-cli

Create Self-signed CA certificate for development use and issue server or client certificates, generated using openssl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wrong example

DarkPark opened this issue · comments

you have this example:

myca initcenter --name=ec --path="c:/users/<user>/.myca-ec"

but it fails with error:

length of pass must at least 4

will fix.
thanks

will fix after refactor of relative modules.
thanks

Which version you used ?

myca --version
# should output 0.2.3

It goes on without problem under both win7 and centos7:

myca initcenter --name=ec --path="c:/users/<user>/.myca-ec"

Ubuntu 18.04.1 LTS x86_64

I mean which myca-cli version

myca --version
# should output 0.2.3

my output:

$ myca --version
0.2.3

pls try new myca-cli version v0.2.4:

npm i myca-cli@latest
// OR
npm i -g myca-cli@latest

still the same:

$ myca initca --name=ec
length of pass must at least 4

waiting distinguish

what do you mean?

I'll distinguish the issue. wait it.

try

npm i -g myca-cli@latest

then run:

myca --version
myca init -d
myca initcenter --name=ec --path="/tmp/myca-ec" -d
$ myca --version
2.0.0

$ myca init -d
{ cmd: 'init', options: null, needHelp: false, debug: true }
Default center created at path: "/home/dp/.myca"

$ myca initcenter --name=ec -d
/usr/lib/node_modules/myca-cli/dist/bin/myca-cli.js:234
        throw new Error('value of path empty')
        ^

Error: value of path empty
    at parseInitCenter (/usr/lib/node_modules/myca-cli/dist/bin/myca-cli.js:234:15)
    at parseOpts (/usr/lib/node_modules/myca-cli/dist/bin/myca-cli.js:166:16)
    at Object.<anonymous> (/usr/lib/node_modules/myca-cli/dist/bin/myca-cli.js:319:53)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)

param of path missing!
myca initcenter --name=ec --path="/tmp/myca-ec" -d

$ myca initcenter --name=ec --path="/home/dp/.myca" -d
{ cmd: 'initcenter',
  options: { name: 'ec', path: '/home/dp/.myca' },
  needHelp: false,
  debug: true }
{ name: 'ec', path: '/home/dp/.myca' }
{ name: 'ec', path: '/home/dp/.myca' }
center created with:
  centerName: "ec"
  path: "/home/dp/.myca"

But myca init has already created this directory. Why do you force me to enter it manually? I'm okay with the default dir.

In most cases we need not initcenter, except for multiple CA file such as one RSA and other EC, So i must create an individual folder containnin all necessary folders and copy of configure files.
It must specify unique path for each named center during calling initcenter() hence .

@DarkPark try latest myca-cli , path of initcenter() can be ommited

myca initcenter --name=ec --path="/tmp/myca-ec" -d
// OR
myca initcenter --name=ecc -d

it works

$ myca initcenter --name=ec -d
{ cmd: 'initcenter',
  options: { name: 'ec', path: undefined },
  needHelp: false,
  debug: true }
{ name: 'ec', path: undefined }
center created with:
  centerName: "ec"
  path: "/home/dp/.myca-1548162251558"

though I would prefer path: "/home/dp/.myca-ec"

@DarkPark

npm i -g myca-cli@latest
myca initcenter --name=foo -d

path suffix from center name

👍