Support the TLS connection when communicating with etcd cluster. We added a configuration item to custom the certificate verification. Whether to setup TLS connection or not depends on the endpoints' scheme, for instance, when endpoints are:
```
etcd:
host:
- "https://127.0.0.1:2379"
- "https://127.0.0.1:3379"
```
APISIX will originate TLS connection automatically, and the Server Name Indication extention will be set by the endpoint host (`127.0.0.1` in above case). Note by default APISIX will verify the certificate, close the verification in configuration explicitly if you want to bypass it.
```
etcd:
tls:
verfiy: false
```
* bugfix: create the etcd object in `xpcall`, it may fail, the return values of `etcd.new` should be `res, err`.
fix issue: #2310
1. The old process, if creating etcd fails, etcd data will no longer be synchronized. We need to create the etcd object in xpcall.
2. the return value should be res, err of etcd.new.
* test: old test case is unstable, should delete some checkpoint which is wrong.
* feat: add more metrics for prometheus
* test: add test cases
* fix: check lint error
* remove hostname metrics. -> can't save string value.
* add more index
* add X-Etcd-Index
* fix lint
* test: add more test cases
* fix: Avoid the index to exceed 1000 by updating other keys that will causing a full reload
* add prev_index
* fix lint
* fix: fetch key first
* fix: test error
* fix update version only when waitdir error is timeout
* test
* fix: sleep more time
* fix: code style
* fix: code style
* bugfix(lrucache): one common use case for this library is avoid the so-called "dog-pile effect",
that is, to limit concurrent backend queries for the same key when a cache miss happens.
* bugfix: catch the error messag by pcall, it may fail when generate new validator.
* bugfix: to get the HTTP request header by `ngx.var.*`, we need to convert
the name to lower case with dashes replaced by underscores.
more information:
http://nginx.org/en/docs/http/ngx_http_core_module.html#var_http_
* change: the key should be a string object when fetching a value from `ctx.var`.
* bug(make lint): If the code style is bad, do exit with code 1.
* change: don't strip square brackets from the IPv6
The OpenResty APIs require the IPv6 literal wrapped inside a square brackets.
Also add tests for IPv6 upstream and update lua-resty-ipmatcher to 0.3.
Fix#816.