cfssl icon indicating copy to clipboard operation
cfssl copied to clipboard

cfssl sign remote fails parsing the remote parameter

Open adrianblakey opened this issue 7 years ago • 2 comments

cfssl sign -remote "127.0.0.1:8888" -loglevel=0 -profile "CA" client.csr | cfssljson -bare my-client 2019/01/08 12:20:26 [DEBUG] validating configuration 2019/01/08 12:20:26 [DEBUG] validate local profile 2019/01/08 12:20:26 [DEBUG] profile is valid 2019/01/08 12:20:26 [DEBUG] validating configuration 2019/01/08 12:20:26 [DEBUG] validate local profile 2019/01/08 12:20:26 [DEBUG] profile is valid 2019/01/08 12:20:26 [ERROR] bad url: parse 127.0.0.1:8888: first path segment in URL cannot contain colon {"code":5300,"message":"failed to connect to remote"} Failed to parse input: unexpected end of JSON input

adrianblakey avatar Jan 08 '19 20:01 adrianblakey

I'm suffering the same issue. After some debugging, I think I characterized the problem. It seems to be that the parsing of the remote name fails if it's an IP address vs a resolvable hostname.

=> cfssl version
Version: 1.3.2
Revision: dev
Runtime: go1.9.2

=> cat /etc/hosts
...
172.17.0.1	dung
...

# Note -remote=IP:PORT
=> cfssl gencert -remote=172.17.0.1:9999 /csr/intermediate_ca/input/intermediate_ca-csr.json
2019/01/17 16:03:18 [INFO] generate received request
2019/01/17 16:03:18 [INFO] received CSR
2019/01/17 16:03:18 [INFO] generating key: ecdsa-256
2019/01/17 16:03:18 [INFO] encoded CSR
2019/01/17 16:03:18 [ERROR] bad url: parse 172.17.0.1:9999: first path segment in URL cannot contain colon
{"code":5300,"message":"failed to connect to remote"}

# Note -remote=HOSTNAME:PORT
=> cfssl gencert -remote=dung:9999 /csr/intermediate_ca/input/intermediate_ca-csr.json
2019/01/17 16:04:34 [INFO] generate received request
2019/01/17 16:04:34 [INFO] received CSR
2019/01/17 16:04:34 [INFO] generating key: ecdsa-256
2019/01/17 16:04:34 [INFO] encoded CSR
2019/01/17 16:04:34 [WARNING] This certificate lacks a "hosts" field. This makes it unsuitable for
websites. For more information see the Baseline Requirements for the Issuance and Management
of Publicly-Trusted Certificates, v.1.1.6, from the CA/Browser Forum (https://cabforum.org);
specifically, section 10.2.3 ("Information Requirements").
{"cert":"-----BEGIN CERTIFICATE-----
...
-----END EC PRIVATE KEY-----\n"}

raycrawford avatar Jan 17 '19 15:01 raycrawford

Hi Any way of defining the port on the signer.conf when using remotes? Or is mandatory to use HOSTNAME:PORT?

Thanks

pedromreis avatar Jul 04 '19 08:07 pedromreis