skip to Main Content

We wanted to upgrade OpenSSL in centos 7 but it didn’t happen, the reason may be this.
Upgrading CentOS 7 to OpenSSL 1.1.1 by yum install openssl11

I’ve came to know openssl11 is for "spot" usage. Can we link python / pyOpenssl with openssl11.
Please give me the process, if possible

2

Answers


  1. I just ran into this problem today while trying to build Python 3.10 on CentOS 7, and found this thread while trying to figure it out. In my case I’m just trying to get all of Python to build, including the SSL module which it attempts to build by default. What follows may or may not be adaptable to building pyOpenSSL by itself.

    I found that the configure script appears to be designed to work with OpenSSL files that are installed in the normal locations in /usr/lib64 and /usr/include, or alternatively in one single location that you can specify on the command line with the –with-openssl parameter, under which you can find the include files and libraries directly. The ‘openssl11-devel’ package in RHEL/CentOS 7 satisfies neither of these expectations, and as far as I can tell this can’t be dealt with on the configure command line.

    I found the easiest way to work around it was to just change the library name the script is using with its pkg-config queries, so it can get the correct details from the .pc file which fortunately is in the standard location under /usr/lib64/pkgconfig but with a different name.

    The approach I used happens to work with an install of Python3.10.0 on CentOS 7, though admittedly it’s brittle and may not continue to work with other versions. From within the source directory:

    sed -i 's/PKG_CONFIG openssl /PKG_CONFIG openssl11 /g' configure
    

    Having done the above, I run ./configure. I see in the output:

    checking whether compiling and linking against OpenSSL works… yes

    …rather than the ‘no’ I was getting before.

    Probably unrelated — I am unable to get the compile to work with –enable-optimizations on CentOS 7, for whatever reason. I get the ‘Could not import runpy module’ error, so I configure without it.

    Login or Signup to reply.
  2. I had to install Python 3.10.6 in a CentOS 7 server and I found this mail thread that helped me create the OpenSSL 1.1.1 "spot" installation and use it in the Python installation.

    I decided to install all in /opt but you can choose a different location.

    # Install OpenSSL 1.1.1
    cd /opt
    curl https://ftp.openssl.org/source/old/1.1.1/openssl-1.1.1j.tar.gz --output openssl.tar.gz
    tar xzf openssl.tar.gz
    rm openssl.tar.gz
    cd openssl-1.1.1j/
    ./config --prefix=/opt/openssl && make && make install
    
    # Install Python 3.10.6
    cd /opt
    wget https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tgz
    tar xzf Python-3.10.6.tgz
    cd Python-3.10.6
    ./configure --with-openssl=/opt/openssl
    make
    make altinstall
    

    Test installation

    python3.10 --version
    # Output: Python 3.10.6
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search