lua-resty-etcd icon indicating copy to clipboard operation
lua-resty-etcd copied to clipboard

How to configure etcd ssl connection

Open Hanoboo opened this issue 1 year ago • 0 comments

I tried to connect etcd with ssl certificate, but failed and reported an error.

  • code
local function connectEtcd()
    local conf = _M.conf
    local opt = {
        http_host = conf.etcd_endpoints,
        ssl_cert_path = conf.ssl_cert_path,
        ssl_key_path = conf.ssl_key_path,
        trusted_ca = conf.trusted_ca
    }
    local cli, err = etcd.new(opt)
    if not cli then
        return nil, err
    end
    return cli,nil
end
  • error SSL_do_handshake() failed (SSL: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate:SSL alert number 42)

  • question

Is the parameter trusted_ca the path to ca.pem to be passed in?

Hanoboo avatar Apr 01 '24 06:04 Hanoboo