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

[Question] Does connect function do not allowed the self-signed client cert and private key

Open Jiajie-Ma-LF opened this issue 1 year ago • 0 comments

When I use the code like:

httpc:connect(
            {
                scheme = scheme,
                host = host,
                port = port,
                ssl_client_cert = ssl_client_cert,
                ssl_client_priv_key = ssl_client_priv_key
            }
        )

The ssl_client_cert and ssl_client_priv_key is a self-signed certificate, then I got the below error message:

Request failed: Connection attempt failed: 19: self signed certificate in certificate chain

BTW, the same cert and key works well by using ssl.https.request with the below code:

luasocket_https.request {
        url = url,
        headers = headers,
        source = ltn12.source.string(body),
        sink = ltn12.sink.table(resp_buffer),
        key = ssl_client_priv_key,
        certificate = ssl_client_cert
    }

My question is: The connect function of lua-resty-http does not support for a given self-signed certificate?

Jiajie-Ma-LF avatar Aug 28 '24 01:08 Jiajie-Ma-LF