AWS Pipeline eb init failed

0

I have an AWS Pipeline pulling my source code from github and deploying it to the Elastic Beanstalk using a buildspec.yml file The deployment was working fine until today i keep getting this error

"Import Error urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with OpenSSL 1.0.2k-fips"

I found that the urllib3 had an update on 2023-04-26 which removed the support of OpenSSL versions earlier than 1.1.1 The default OpenSSL installed on my build machine is v1.0.2

I've tried to install OpenSSL v1.1.1 using this command **yum install openssl11 openssl11-devel ** but i still get the same error How can i recompile the 'ssl' module with the new version of the OpenSSL

buildspec.yml content

version: "0.2"
phases:
  install:
    runtime-versions:
      java: corretto8
    commands:
      - yum install openssl11 openssl11-devel ncurses-devel libffi-devel sqlite-devel.x86_64 readline-devel.x86_64 bzip2-devel.x86_64 -y
      - git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git
      - python aws-elastic-beanstalk-cli-setup/scripts/ebcli_installer.py
      - echo 'export PATH="/root/.ebcli-virtual-env/executables:$PATH"' >> ~/.bash_profile && source ~/.bash_profile
  pre_build:
    commands:
      - echo "Entered the pre-build phase"
  build:
    commands:
      - echo "Entered build phase"
      - mvn clean compile install
  post_build:
    commands:
      - echo "Entered Post build phase (deploy phase)"
      - eb init $AWS_EB_APP_NAME -r $AWS_EB_REGION
      - eb use $AWS_EB_ENV_NAME
      - eb deploy --staged -nh
artifacts:
  files:
    - target/*.jar
cache:
  paths:
    - "/root/.m2/**/*"

Screenshot of the error

Enter image description here

  • I've tried to install OpenSSL v1.1.1 using this command **yum install openssl11 openssl11-devel ** but i still get the same error How can i recompile the 'ssl' module with the new version of the OpenSSL

    i tried similiar thing also checked that indeed the openssl version was 1.1.1f (using openssl version) , used pip install urllib3==1.26.15 and pip install requests==2.28.1 as my lambda was using "request" module.

    https://repost.aws/questions/QUPrAJ9DjyRlWMMe5r_yS6ug/lambdas-using-urllib3-2-0-0-fails-in-python-3-8-runtime

    still getting same error and the question is why it is not picking up the changed version

asked a year ago432 views
1 Answer
3
Accepted Answer

One potential solution would be to build a custom Amazon Machine Image (AMI) with OpenSSL 1.1.1+ installed, and use this custom AMI in your build environment. You could also try upgrading your current instance's OpenSSL to 1.1.1+ by downloading and building it manually from the source code. Alternatively, you can also try upgrading your Elastic Beanstalk environment to a newer platform version that includes OpenSSL 1.1.1+.

profile picture
EXPERT
answered a year ago
  • Thank you for your answer, I did upgrade my Amazon linux 2 machine to v4 and the issue is resolved

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions