小编Deb*_*dez的帖子

使用 ssl 在 Freebsd 11 上安装 Python 3.7

我正在尝试在具有 ssl 支持的 Freebsd 11.1 上安装 Python 3.7。

尝试 #1:由于找不到 libdl.so.1,预构建的二进制文件将无法运行

pkg install python37
...
root@s0001:~ # python3.7
Shared object "libdl.so.1" not found, required by "python3.7"
Run Code Online (Sandbox Code Playgroud)

尝试 #2:我下载了 python 3.7 源代码并尝试使用默认值进行构建,但未找到 ssl 模块

./configure
make
...
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_gdbm                 _sqlite3              _ssl
_tkinter              spwd
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Run Code Online (Sandbox Code Playgroud)

尝试 #3:我注意到 python tarball 中有 openssl 1.1.1 的源代码,所以我尝试了 --with-openssl,但遇到了编译器错误:

./configure …
Run Code Online (Sandbox Code Playgroud)

python openssl freebsd

5
推荐指数
1
解决办法
3756
查看次数

nginx Stream_ssl_preread 模块无法读取 ssl_preread_server_name

我正在尝试设置 nginx 以根据 SNI 服务器名称将 TLS 连接映射到不同的后端。据我所知,我的客户端正在发送服务器名称,但预读模块仅读取连字符。

这是我的 nginx 配置:

stream  {
    map_hash_bucket_size 64;

    ############################################################
    ### logging
    log_format log_stream '$remote_addr [$time_local] $protocol [$ssl_preread_server_name] [$ssl_preread_alpn_protocols] [$instanceport] '
        '$status $bytes_sent $bytes_received $session_time';

    error_log   /usr/home/glance/Logs/pservernginx.error.log info;
    access_log  /usr/home/glance/Logs/pservernginx.access.log log_stream;

    ############################################################
    ### ssl configuration

    ssl_certificate      /usr/home/glance/GlanceReleases/star.myglance.org.pem;
    ssl_certificate_key  /usr/home/glance/GlanceReleases/star.myglance.org.pem;

    ssl_protocols       TLSv1.1 TLSv1.2;
    ssl_ciphers         HIGH:!aNULL:!MD5:!RC4;

    limit_conn_zone $binary_remote_addr zone=ip_addr:10m;

    ########################################################################
    ### Raw TLS PServer Connections
    ### Listen for TLS on 5501 and forward to TCP sock 6500 (socket port)

    ### https://nginx.org/en/docs/stream/ngx_stream_ssl_preread_module.html
    map $ssl_preread_server_name $instanceport {
        presence.myglance.org      6500; …
Run Code Online (Sandbox Code Playgroud)

ssl sni nginx-config

5
推荐指数
1
解决办法
7391
查看次数

需要帮助安装python 3的请求

我想在FreeBSD上为python 3安装"请求"模块.我正在使用python 3.2,但我也在机器上安装了python 2.6.

我安装了pip.

pip --version 
pip 1.1 from /usr/local/lib/python3.2/site-packages (python 3.2)
Run Code Online (Sandbox Code Playgroud)

我运行了pip安装请求

我收到了一堆语法错误,从以下开始:

  File "/usr/local/lib/python3.2/site-packages/requests/packages/chardet/chardistribution.py", line 48
    self._mDone = constants.False # If this flag is set to constants.True, detection is done and conclusion has been made
                                ^
SyntaxError: invalid syntax

  File "/usr/local/lib/python3.2/site-packages/requests/packages/chardet/charsetgroupprober.py", line 44
    prober.active = constants.True
                                 ^
SyntaxError: invalid syntax

  File "/usr/local/lib/python3.2/site-packages/requests/packages/chardet/constants.py", line 46
    False = __builtin__.False
Run Code Online (Sandbox Code Playgroud)
  1. 我是否以某种方式获得了python 2版本的"请求"?
  2. 当我运行"python"时,我得到版本2.6.6.我必须明确地运行"python3.2".我是否需要做一些事情才能让3.2成为我的默认python安装?

python-3.x python-requests

4
推荐指数
1
解决办法
7680
查看次数