• RE Version of OpenSSl ?

    From vincent.vandevyvre@vincent.vandevyvre@oqapy.eu to comp.lang.python on Sun Feb 9 07:54:01 2025
    From Newsgroup: comp.lang.python

    HI Vincent.

    You need the sources of the OpenSSL library, not the compiled library.
    On Ubuntu, the packages with sources are typically named xxx-dev where
    xxx is the package that provides the library. I don't have a Ubuntu currently, but try looking for something like openssl-dev or
    libopenssl-dev etc.

    Thanks, the dev packege seems named libssl-dev.
    But:
    ----------------------------------------------------------------
    $ sudo apt install libssl-dev
    [sudo] Mot de passe de vincent :
    Lecture des listes de paquets... Fait
    Construction de l'arbre des dépendances... Fait
    Lecture des informations d'état... Fait
    libssl-dev est déjà la version la plus récente (3.0.13-0ubuntu3.4). ----------------------------------------------------------------
    In english: "libssl-dev is already the most recent version (3.0.13-0ubuntu3.4).

    Vincent--- Synchronet 3.20c-Linux NewsLink 1.2
  • From vincent.vandevyvre@vincent.vandevyvre@oqapy.eu to comp.lang.python on Sun Feb 9 11:49:27 2025
    From Newsgroup: comp.lang.python


    In case this helps you find the correct package to install:

    $ python3 -c "if True:
    import ssl
    print('Ok.')
    "
    Ok.

    $ cat /etc/lsb-release
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=24.04
    DISTRIB_CODENAME=noble
    DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"

    $ apt list --installed | grep ssl

    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

    libssl-dev/noble-updates,noble-security,now 3.0.13-0ubuntu3.4 amd64 [installed]
    libssl3t64/noble-updates,noble-security,now 3.0.13-0ubuntu3.4 amd64 [installed,automatic]
    libxmlsec1t64-openssl/noble,now 1.2.39-5build2 amd64 [installed,automatic] openssl/noble-updates,noble-security,now 3.0.13-0ubuntu3.4 amd64 [installed,automatic]
    ssl-cert/noble,noble,now 1.1.2ubuntu1 all [installed,automatic]

    Thanks Jason, I have near the same result of you.
    I need to explain the context.
    I'm on a new machine with a fresh install of Ubuntu 24.04 wich embed Python 3.12.3, no problem with that.

    As I'm maintainer of some Python modules published on PyPI, I've the habit of testing my modules in different virtual environments. For now Python 3.11, 3.12 and 3.13.

    So, I've maybe found a solution:

    I've create in my home a dir named /opt, download into it the latest version of openssl-1.1.1 and uncompress it.(*)
    -------------------------------------------------------------
    $ cd opt/openssl-1.1.1w
    $ ./config && make && make test
    $ mkdir $HOME/opt/lib
    $ mv $HOME/opt/openssl-1.1.1w/libcrypto.so.1.1 $HOME/opt/lib/
    $ mv $HOME/opt/openssl-1.1.1w/libssl.so.1.1 $HOME/opt/lib/
    $ export LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH --------------------------------------------------------------
    And rerun the compilation of 3.12.9 without problem with openssl.

    (*) https://openssl-library.org/source/old/1.1.1/index.html

    Vincent.


    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Left Right@olegsivokon@gmail.com to comp.lang.python on Sun Feb 9 19:06:14 2025
    From Newsgroup: comp.lang.python

    So, this is how I know where my SSL headers are found, for instance:
    ➜ cpython git:(3.12) gcc -I. -I./Include -H ./Modules/_ssl.c 2>&1 | grep evp.h
    .. /usr/include/openssl/evp.h
    (this was executed from the repository root).
    Can you see if you get something similar?
    Also... just for sanity check: did you run .configure? There's a lot
    of twisted logic there trying to find OpenSSL. And, unfortunately,
    error reporting is very poor. (The error you are getting comes way,
    way after everything bad has already happened and all knowledge of how
    it happened is lost). Just all around atrocious error handling.
    On Sun, Feb 9, 2025 at 5:51 PM Vincent Vande Vyvre via Python-list <python-list@python.org> wrote:


    In case this helps you find the correct package to install:

    $ python3 -c "if True:
    import ssl
    print('Ok.')
    "
    Ok.

    $ cat /etc/lsb-release
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=24.04
    DISTRIB_CODENAME=noble
    DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"

    $ apt list --installed | grep ssl

    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

    libssl-dev/noble-updates,noble-security,now 3.0.13-0ubuntu3.4 amd64 [installed]
    libssl3t64/noble-updates,noble-security,now 3.0.13-0ubuntu3.4 amd64 [installed,automatic]
    libxmlsec1t64-openssl/noble,now 1.2.39-5build2 amd64 [installed,automatic] openssl/noble-updates,noble-security,now 3.0.13-0ubuntu3.4 amd64 [installed,automatic]
    ssl-cert/noble,noble,now 1.1.2ubuntu1 all [installed,automatic]

    Thanks Jason, I have near the same result of you.
    I need to explain the context.
    I'm on a new machine with a fresh install of Ubuntu 24.04 wich embed Python 3.12.3, no problem with that.

    As I'm maintainer of some Python modules published on PyPI, I've the habit of testing my modules in different virtual environments. For now Python 3.11, 3.12 and 3.13.

    So, I've maybe found a solution:

    I've create in my home a dir named /opt, download into it the latest version of openssl-1.1.1 and uncompress it.(*)
    -------------------------------------------------------------
    $ cd opt/openssl-1.1.1w
    $ ./config && make && make test
    $ mkdir $HOME/opt/lib
    $ mv $HOME/opt/openssl-1.1.1w/libcrypto.so.1.1 $HOME/opt/lib/
    $ mv $HOME/opt/openssl-1.1.1w/libssl.so.1.1 $HOME/opt/lib/
    $ export LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH --------------------------------------------------------------
    And rerun the compilation of 3.12.9 without problem with openssl.

    (*) https://openssl-library.org/source/old/1.1.1/index.html

    Vincent.


    --
    https://mail.python.org/mailman/listinfo/python-list
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Keith Thompson@Keith.S.Thompson+u@gmail.com to comp.lang.python on Sun Feb 9 17:28:28 2025
    From Newsgroup: comp.lang.python

    vincent.vandevyvre@oqapy.eu writes:
    In case this helps you find the correct package to install:

    $ python3 -c "if True:
    import ssl
    print('Ok.')
    "
    Ok.

    $ cat /etc/lsb-release
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=24.04
    DISTRIB_CODENAME=noble
    DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"

    $ apt list --installed | grep ssl

    WARNING: apt does not have a stable CLI interface. Use with caution in
    scripts.

    libssl-dev/noble-updates,noble-security,now 3.0.13-0ubuntu3.4 amd64
    [installed]
    libssl3t64/noble-updates,noble-security,now 3.0.13-0ubuntu3.4 amd64
    [installed,automatic]
    libxmlsec1t64-openssl/noble,now 1.2.39-5build2 amd64 [installed,automatic] >> openssl/noble-updates,noble-security,now 3.0.13-0ubuntu3.4 amd64
    [installed,automatic]
    ssl-cert/noble,noble,now 1.1.2ubuntu1 all [installed,automatic]

    Thanks Jason, I have near the same result of you.
    I need to explain the context.
    I'm on a new machine with a fresh install of Ubuntu 24.04 wich embed Python 3.12.3, no problem with that.

    As I'm maintainer of some Python modules published on PyPI, I've the
    habit of testing my modules in different virtual environments. For now
    Python 3.11, 3.12 and 3.13.

    So, I've maybe found a solution:

    I've create in my home a dir named /opt, download into it the latest version of openssl-1.1.1 and uncompress it.(*)
    -------------------------------------------------------------
    $ cd opt/openssl-1.1.1w
    $ ./config && make && make test
    $ mkdir $HOME/opt/lib
    $ mv $HOME/opt/openssl-1.1.1w/libcrypto.so.1.1 $HOME/opt/lib/
    $ mv $HOME/opt/openssl-1.1.1w/libssl.so.1.1 $HOME/opt/lib/
    $ export LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH --------------------------------------------------------------
    And rerun the compilation of 3.12.9 without problem with openssl.

    (*) https://openssl-library.org/source/old/1.1.1/index.html

    OpenSSL 1.1.1 is pretty old, released in 2018 if I'm not mistaken.

    An environment on Ubuntu 24.04 with OpenSSL 1.1.1 libraries is a bit
    unusual. If your goal is to ensure that you can build Python with the
    oldest OpenSSL it claims to support, what you're doing makes sense. But
    if you have libssl-dev already installed and your Python build complains "Python requires a OpenSSL 1.1.1 or newer", then something weird is
    going on, and it's probably worth tracking it down. The best solution
    *should* be to install the current libssl-dev package from the package
    manager, not to build an old version of OpenSSL from source.

    I've built Python-3.12.9 from source on Ubuntu-22.04 with no problems
    (I have libssl-dev installed).

    To be clear, what is the output of "dpkg -l libssl-dev" on your Ubuntu
    24.04 system? If you get something similar to this:

    ```
    $ dpkg -l libssl-dev
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name Version Architecture Description +++-================-==============-============-================================================
    ii libssl-dev:amd64 3.3.1-2ubuntu2 amd64 Secure Sockets Layer toolkit - development files
    ```

    then I don't understand why you'd get the "Python requires a OpenSSL
    1.1.1 or newer" message.
    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */
    --- Synchronet 3.20c-Linux NewsLink 1.2