`Unknown private key error` when using a remote auth config
- Dominant language
- Go
- Stars
- 9.5k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
I have an issuing CA setup that I can issue default certificates from, but cannot get signing profiles to work. On the CA I'm using the following configuration:
``` json
{
"auth_keys": {
"server_auth": {
"type":"standard",
"key":"ABCDABCDABCDABCDABCDABCDABCDABCD"
}
},
"remotes": {
"localhost": "127.0.0.1:8888"
},
"signing": {
"profiles": {
"server": {
"usages": ["server auth, key encipherment, signing"],
"expiry": "2160h",
"remote":"localhost",
"auth_key": "server_auth"
}
},
"default": {
"usages": ["digital signature"],
"expiry": "8000h"
}
}
}
```
If I remove the `remotes` section, and try to use the following config, I get a `{"code":5200,"message":"invalid configuration"}` error:
``` json
{
"auth_keys": {
"server_auth": {
"type":"standard",
"key":"ABCDABCDABCDABCDABCDABCDABCDABCD"
}
},
"signing": {
"profiles": {
"server": {
"usages": ["server auth, key encipherment, signing"],
"expiry": "2160h",
"auth_key": "server_auth"
}
},
"default": {
"usages": ["digital signature"],
"expiry": "8000h"
}
}
}
```
On the server I'm trying to pull a certificate with, I've tried the following config (which I got from Issue #556 ), but it results in the `{"code":2000,"message":"Unknown private key error"}` mentioned in the title:
``` json
{
"auth_keys": {
"key1": {
"key": "ABCDABCDABCDABCDABCDABCDABCDABCD",
"type": "standard"
}
},
"remotes": {
"caserver": "10.7.29.4:8888"
},
"signing": {
"profiles" : {
"server": {
"auth_remote": {
"auth_key": "key1",
"remote": "caserver"
}
}
}
}
}
```
A `-loglevel 0` flag on the gives me the following, so I'm not sure what I'm missing:
```
2016/06/30 13:44:07 [DEBUG] loading configuration file from config.json
2016/06/30 13:44:07 [DEBUG] no default given: using default config
2016/06/30 13:44:07 [DEBUG] match auth remote in profile to remotes section
2016/06/30 13:44:07 [DEBUG] match auth remote key in profile to auth_keys section
2016/06/30 13:44:07 [DEBUG] validating configuration
2016/06/30 13:44:07 [DEBUG] validate local profile
2016/06/30 13:44:07 [DEBUG] profile is valid
2016/06/30 13:44:07 [DEBUG] validate auth remote profile
2016/06/30 13:44:07 [DEBUG] profile is valid
2016/06/30 13:44:07 [DEBUG] configuration ok
2016/06/30 13:44:07 [INFO] generate received request
2016/06/30 13:44:07 [INFO] received CSR
2016/06/30 13:44:07 [INFO] generating key: rsa-2048
2016/06/30 13:44:07 [DEBUG] generate key from request: algo=rsa, size=2048
2016/06/30 13:44:07 [INFO] encoded CSR
2016/06/30 13:44:07 [DEBUG] validating configuration
2016/06/30 13:44:07 [DEBUG] validate local profile
2016/06/30 13:44:07 [DEBUG] profile is valid
2016/06/30 13:44:07 [DEBUG] validate auth remote profile
2016/06/30 13:44:07 [DEBUG] profile is valid
{"code":2000,"message":"Unknown private key error"}
Failed to parse input: unexpected end of JSON input
```
If I try to pull a certificate with a default cert instead of a signing profile, I can get a cert just fine. If I try to pull a signing profile without authentication, it fails. Really unsure what I'm missing here, and I've been going through making notes where the docs could be updated (should be submitting a PR for that at some point), but I just can't seem to get this working.
Contributor guide
Assessment
This issue has not been assessed yet.