awslabs / aws-lambda-cpp

C++ implementation of the AWS Lambda runtime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Protocol "https" not supported or disabled in libcurl

callumjohnspiller opened this issue · comments

I'm trying as hard as I can to get a simple function to run as a AWS Lambda function from a docker container image.

I have set the following in my code:

Client::ClientConfiguration clientConfig; clientConfig.region = "eu-west-2"; clientConfig.caFile = "/etc/pki/tls/certs/ca-bundle.crt";

And am running on amazonlinux:latest as a docker container.
I have also installed:

RUN yum -y groupinstall "Development tools" RUN yum install -y gcc-c++ libcurl-devel openssl-devel openssl-static zlib-devel cmake3 git RUN pip3 install awscli

prior to compilation on the container.

However I keep getting the below error messages in cloudwatch and I have no idea why. The docs make it seem like accessing s3 should be possible if I do all these things, however I am scratching my head.

Any help would be greatl;y appreciated!

`[DEBUG] 2023-02-13 22:49:12.928 CurlHandleContainer [139922550016256] Attempting to acquire curl connection.

[INFO] 2023-02-13 22:49:12.928 CurlHandleContainer [139922550016256] Connection has been released. Continuing.

[DEBUG] 2023-02-13 22:49:12.928 CurlHandleContainer [139922550016256] Returning connection handle 0x5f84240

[DEBUG] 2023-02-13 22:49:12.928 CurlHttpClient [139922550016256] Obtained connection handle 0x5f84240

[DEBUG] 2023-02-13 22:49:12.928 CURL [139922550016256] (Text) Protocol "https" not supported or disabled in libcurl

[DEBUG] 2023-02-13 22:49:12.928 CURL [139922550016256] (Text) Closing connection -1
[ERROR] 2023-02-13 22:49:12.928 CurlHttpClient [139922550016256] Curl returned error code 1 - Unsupported protocol
[DEBUG] 2023-02-13 22:49:12.928 CurlHandleContainer [139922550016256] Destroy curl handle: 0x5f84240
[DEBUG] 2023-02-13 22:49:12.928 CurlHandleContainer [139922550016256] Created replacement handle and released to pool: 0x5f84240
[DEBUG] 2023-02-13 22:49:12.928 AWSClient [139922550016256] Request returned error. Attempting to generate appropriate error codes from response
[ERROR] 2023-02-13 22:49:12.928 AWSXmlClient [139922550016256] HTTP response code: -1
Resolved remote host IP address:
Request ID:
Exception name:
Error message: curlCode: 1, Unsupported protocol
0 response headers:
[WARN] 2023-02-13 22:49:12.928 AWSClient [139922550016256] If the signature check failed. This could be because of a time skew. Attempting to adjust the signer.
[DEBUG] 2023-02-13 22:49:12.928 AWSClient [139922550016256] Date header was not found in the response, can't attempt to detect clock skew
Error: GetObject: : curlCode: 1, Unsupported protocol
END RequestId: 4ca58201-68f8-4dc5-bf6a-8a014c9982eb
REPORT RequestId: 4ca58201-68f8-4dc5-bf6a-8a014c9982eb Duration: 25562.03 ms Billed Duration: 27567 ms Memory Size: 500 MB Max Memory Used: 32 MB Init Duration: 2004.15 ms `

It seems like libcurl is compiled without TLS support.
I would look at the packages installed on the containers and make sure there aren't multiple versions of libcurl installed. And if there is, which one is getting picked by the linker?
Run ldd on the aws sdk .so file to see which libcurl is getting linked.

Hi @marcomagdy thanks for your comment.

I managed to figure out the issue just earlier today. While libcurl was installed in the dockerfile, the CMakeLists.txt for my c++ source code was linking in a version of curl for another library I am using which ended up being the version that was used when invoking the lambda function.

Removing curl from that CMakeLists.txt file solved the issue and the program ran using libcurl-devel as in the Dockerfile.

Thanks again for your help 👍