Closed allthingsclowd closed 4 years ago
Resolved with the above PR #7024 - thank you
vagrant@app01:~$ /usr/local/bin/consul connect envoy -http-addr=https://127.0.0.1:8321 -ca-file=/usr/local/bootstrap/certificate-config/consul-ca.pem -client-cert=/usr/local/bootstrap/certificate-config/cli.pem -client-key=/usr/local/bootstrap/certificate-config/cli-key.pem -token=${SERVICETOKEN} -sidecar-for httpecho -bootstrap
{
"admin": {
"access_log_path": "/dev/null",
"address": {
"socket_address": {
"address": "127.0.0.1",
"port_value": 19000
}
}
},
"node": {
"cluster": "httpecho",
"id": "httpecho-sidecar-proxy"
},
"static_resources": {
"clusters": [
{
"name": "local_agent",
"connect_timeout": "1s",
"type": "STATIC",
"tls_context": {
"common_tls_context": {
"validation_context": {
"trusted_ca": {
"inline_string": "-----BEGIN CERTIFICATE-----\nMIIC7TCCApSgAwIBAgIRAM3rRDt+uEgHLc0aVWKJvNMwCgYIKoZIzj0EAwIwgbkx\nCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNj\nbzEaMBgGA1UECRMRMTAxIFNlY29uZCBTdHJlZXQxDjAMBgNVBBETBTk0MTA1MRcw\nFQYDVQQKEw5IYXNoaUNvcnAgSW5jLjFAMD4GA1UEAxM3Q29uc3VsIEFnZW50IENB\nIDI3MzcxMzMxMjgxNTE5NTk2ODgyNDI4MjcyOTA0MDg2ODY1NDI5MTAeFw0yMDAx\nMDcxMjI1MzlaFw0yNTAxMDUxMjI1MzlaMIG5MQswCQYDVQQGEwJVUzELMAkGA1UE\nCBMCQ0ExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xGjAYBgNVBAkTETEwMSBTZWNv\nbmQgU3RyZWV0MQ4wDAYDVQQREwU5NDEwNTEXMBUGA1UEChMOSGFzaGlDb3JwIElu\nYy4xQDA+BgNVBAMTN0NvbnN1bCBBZ2VudCBDQSAyNzM3MTMzMTI4MTUxOTU5Njg4\nMjQyODI3MjkwNDA4Njg2NTQyOTEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARA\nOIKz3Ug46aNtWlib1L79zU1gNfQBqvDJjtVMlz2xf9VwB4o27luxCgG722rxEbTA\nVMBMPngop8B+9hNwmxEXo3sweTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUw\nAwEB/zApBgNVHQ4EIgQgSuKoiV//3Ldz3B9uQ6cDqH/MBSrcVHSWEgn+lnx4/IMw\nKwYDVR0jBCQwIoAgSuKoiV//3Ldz3B9uQ6cDqH/MBSrcVHSWEgn+lnx4/IMwCgYI\nKoZIzj0EAwIDRwAwRAIgFLAO59n/zQ8OmKcH8Ng71qnhbFaq0yKPvEubC5tuEsIC\nIBJT0C01RCWFJxnouBF3l3SKvrHYNCyDG4b86IoN8Wx0\n-----END CERTIFICATE-----\n"
}
}
}
},
"http2_protocol_options": {},
"hosts": [
{
"socket_address": {
"address": "127.0.0.1",
"port_value": 8502
}
}
]
}
]
},
"stats_config": {
"stats_tags": [
{
"regex": "^cluster\\.((?:([^.]+)~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.[^.]+\\.[^.]+\\.[^.]+\\.consul\\.)",
"tag_name": "consul.custom_hash"
},
{
"regex": "^cluster\\.((?:[^.]+~)?(?:([^.]+)\\.)?[^.]+\\.[^.]+\\.[^.]+\\.[^.]+\\.[^.]+\\.consul\\.)",
"tag_name": "consul.service_subset"
},
{
"regex": "^cluster\\.((?:[^.]+~)?(?:[^.]+\\.)?([^.]+)\\.[^.]+\\.[^.]+\\.[^.]+\\.[^.]+\\.consul\\.)",
"tag_name": "consul.service"
},
{
"regex": "^cluster\\.((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.([^.]+)\\.[^.]+\\.[^.]+\\.[^.]+\\.consul\\.)",
"tag_name": "consul.namespace"
},
{
"regex": "^cluster\\.((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.([^.]+)\\.[^.]+\\.[^.]+\\.consul\\.)",
"tag_name": "consul.datacenter"
},
{
"regex": "^cluster\\.((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.[^.]+\\.([^.]+)\\.[^.]+\\.consul\\.)",
"tag_name": "consul.routing_type"
},
{
"regex": "^cluster\\.((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.[^.]+\\.[^.]+\\.([^.]+)\\.consul\\.)",
"tag_name": "consul.trust_domain"
},
{
"regex": "^cluster\\.(((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.[^.]+)\\.[^.]+\\.[^.]+\\.consul\\.)",
"tag_name": "consul.target"
},
{
"regex": "^cluster\\.(((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.[^.]+\\.[^.]+\\.[^.]+)\\.consul\\.)",
"tag_name": "consul.full_target"
},
{
"tag_name": "local_cluster",
"fixed_value": "httpecho"
}
],
"use_all_default_tags": true
},
"dynamic_resources": {
"lds_config": {
"ads": {}
},
"cds_config": {
"ads": {}
},
"ads_config": {
"api_type": "GRPC",
"grpc_services": {
"initial_metadata": [
{
"key": "x-consul-token",
"value": "dc612e72-e2cd-dc8c-b9d2-53315ae41258"
}
],
"envoy_grpc": {
"cluster_name": "local_agent"
}
}
}
}
}
vagrant@app01:~$
@allthingsclowd thanks for the great report. For future ref, it's better to leave issues open - they'll be closed when the PR gets merged and makes sure they stay visible on our project milestones etc.
Overview of the Issue
I am trying to setup a very basic demonstration of Consul Connect Envoy when TLS is enabled but I cannot get it to work. The internal proxy works fine with TLS enabled.
Please note I have very limited Envoy experience but after following the documentation I keep getting this Error with the Envoy Proxy
Unable to parse JSON as proto (INVALID_ARGUMENT:(static_resources.clusters[0].tls_context.common_tls_context.validation_context.trusted_ca.inline_bytes): invalid value "[45 45 45 45 45 6
Reproduction Steps
Simple Demo of How to Setup an Envoy Connect Service when Consul is secured with TLS
The goal of this test was to be able to demonstrate a
productionised
version of a Consul Connect Envoy Service. All online examples today rely on Docker and no TLS - many customers still don't allow Docker in production (I know, unbelieveable!). So I was attempting to running the Envoy proxy directly on Ubuntu without Docker.Deployment Platforms Tested
or
Consul
It's a 3 host setup with a single node Consul Server and two separate Consul Agent nodes running the envoy proxies. I have used all the default settings for Consul with the following exceptions:
HCL Config Server
App Server HCL
Set up environment variables
Everything else is left at Consul Defaults.
Command used to launch envoy proxy
Result