51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

https://docs.python.org/3/using/unix.html#on-linux

2. Using Python on Unix platforms --- Python 3.12.2 documentation

2.5. Custom OpenSSL

  1. To use your vendor's OpenSSL configuration and system trust store, locate the directory with openssl.cnf file or symlink in /etc. On most distribution the file is either in /etc/ssl or /etc/pki/tls. The directory should also contain a cert.pem file and/or a certs directory.

    $ find /etc/ -name openssl.cnf -printf "%h\n"
    /etc/ssl
    
  2. Download, build, and install OpenSSL. Make sure you use install_sw and not install. The install_sw target does not override openssl.cnf.

    $ curl -O https://www.openssl.org/source/openssl-VERSION.tar.gz
    $ tar xzf openssl-VERSION
    $ pushd openssl-VERSION
    $ ./config \
        --prefix=/usr/local/custom-openssl \
        --libdir=lib \
        --openssldir=/etc/ssl
    $ make -j1 depend
    $ make -j8
    $ make install_sw
    $ popd
    
  3. Build Python with custom OpenSSL (see the configure --with-openssl and --with-openssl-rpath options)

    $ pushd python-3.x.x
    $ ./configure -C \
        --with-openssl=/usr/local/custom-openssl \
        --with-openssl-rpath=auto \
        --prefix=/usr/local/python-3.x.x
    $ make -j8
    $ make altinstall
    
赞(0)
未经允许不得转载:工具盒子 » https://docs.python.org/3/using/unix.html#on-linux