skip to Main Content

I have successfully installed an AWS CLI on WSL. In addition I did follow these instructions:
https://aws.amazon.com/blogs/compute/introducing-the-c-lambda-runtime/

Now, the first example works and when I run a testcase all is functioning properly and the test succeeds. However, when I run the example from the link above with the encoder with a test, the execution fails.

This is the error log:

s2n_init() failed: 402653268 (Failed to load or unload an openssl provider)
Fatal error condition occurred in /home/username/aws-sdk-cpp/crt/aws-crt-cpp/crt/aws-c-io/source/s2n/s2n_tls_channel_handler.c:197: 0 && "s2n_init() failed"
Exiting Application
No call stack information available
START RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Version: $LATEST
2022-11-21T09:02:07.642Z xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Task timed out after 1.02 seconds

END RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
REPORT RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  Duration: 1015.50 ms    Billed Duration: 1000 ms    Memory Size: 128 MB Max Memory Used: 16 MB  

Now, there are two hints in here:

  1. failed to load or unload an openssl provider
  2. something with certificates seen the location where the error occured. This location is my local machine which I Find odd since the (binary) code is uploaded to AWS and running there, not on my local machine I’d assume?

Have I missed an installation step somewhere or is my configuration incorrect? What can I do to provide more information for myself and / or solve the issue?

2

Answers


  1. Chosen as BEST ANSWER

    With the help of @barath I succeeded. I'd like to form a complete answer because two issues are to be addressed here:

    1)There is a bug in the "beyond hello" example's main.cpp code

    S3::S3Client client(credentialsProvider, config);
    

    must be:

    S3::S3Client client(config);
    

    2)to get rid of the s2n_init() error, one needs to do as barath explained:

    nano ~/aws-sdk-cpp/crt/aws-crt-cpp/crt/s2n/CMakeLists.txt -l
    

    Comment line 414 to look like this from line 413 to 415

    if (LIBCRYPTO_SUPPORTS_EVP_RC4)
         #target_compile_options(${PROJECT_NAME} PUBLIC -DS2N_LIBCRYPTO_SUPPORTS_EVP_RC4)
    endif()
    

    save the file.

    nano ~/aws-sdk-cpp/crt/aws-crt-cpp/crt/s2n/s2n.mk -l
    

    add a comment on line ~223 such that, from line ~222 the code looks like:

    ifeq ($(TRY_EVP_RC4), 0)
            #DEFAULT_CFLAGS += -DS2N_LIBCRYPTO_SUPPORTS_EVP_RC4
    endif
    

    Now you can continue the example on https://aws.amazon.com/blogs/compute/introducing-the-c-lambda-runtime/ with

    $ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/out
    $ make
    $ make aws-lambda-package-encoder
    

  2. This solution worked – https://www.mail-archive.com/[email protected]/msg91357.html.
    (Disabling S2N_LIBCRYPTO_SUPPORTS_EVP_RC4 in aws-sdk-cpp)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search