mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

This commit lets grpc gateway return a correct error to clients. Even if a client has a cert with non empty CN, current gateway returns an error like below: ``` $ curl --cacert ./integration/fixtures/ca.crt --cert ./integration/fixtures/server.crt --key ./integration/fixtures/server.key.insecure https://localhost:2379/v3/kv/put -X POST -d '{"key": "fromcurl", "value": "test"}' {"error":"etcdserver: user name is empty","code":3} ``` This is because etcd ignores CN from gateway connection. The error will be like this: ``` $ curl --cacert ./integration/fixtures/ca.crt --cert ./integration/fixtures/server.crt --key ./integration/fixtures/server.key.insecure https://localhost:2379/v3/kv/put -X POST -d '{"key": "fromcurl", "value": "test"}' CommonName of client sending a request against gateway will be ignored and not used as expected ``` The error will be returned if the server is enabling auth and gRPC gateway.