博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Installing SSL on CentOS | My Virtual Time Capsule
阅读量:6407 次
发布时间:2019-06-23

本文共 1824 字,大约阅读时间需要 6 分钟。

Installing SSL on CentOS | My Virtual Time Capsule

Installing SSL on CentOS
Extracted from the Source with modification:
Recently on a couple of older CentOS machines I’ve found that the stock Python doesn’t have SSL support, which obviously makes trying to make a HTTPS connection impossible.
The error that comes back from the socket module is:
    AttributeError: 'module' object has no attribute 'ssl'
To get SSL support you will have to compile Python from source and it’s not the most intuitive problem to solve. First up check you have OpenSSL installed correctly. OpenSSL is normally installed in "/usr/bin/openssl", you can use yum to check if it’s installed;
    yum list installed | grep ssl
if for some reason you don’t have it, you can easily install it using yum.
    yum install openssl openssl-devel
Then you will need to get a copy of the Python source, which you can find from the download site.
You then need to edit the Modules/Setup.dist file and uncomment the following (starting on line number 215 in my 2.6 source):
    SSL=/urs/local/ssl
    _ssl _ssl.c
        -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl
        -L$(SSL)/lib -lssl -lcrypto
(You might also need to uncomment the line above starting SSL to point it to your openssl instillation if it can’t be found in your $PATH)
Then run the standard setup:
    ./configure
    make altinstall prefix=~/python2.6.5 exec-prefix=~/python2.6.5
(NOTE: If you are installing a separate Python version from the one
that comes with the distro, it's normally sensible to use the
 altinstall option and not throttle the existing instillation.
That way you don't interfere with OS specific stuff using
Python - such as yum on CentOS)
Once it’s all done, you can test by running the following:
    python -c 'from socket import ssl'
All done! probably shouldn’t be as tricky as that…
About these ads

转载地址:http://jkqea.baihongyu.com/

你可能感兴趣的文章
初级java学习总结
查看>>
我的友情链接
查看>>
2 SQL Server数据的库安装
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
Python之线程
查看>>
linux用户以及权限
查看>>
std学习
查看>>
android学习摘记——自定义Adapter的心得
查看>>
rails ActiveRecord 中的保留关键字
查看>>
网络受限判断及处理
查看>>
我在新浪微博的第1000篇,截图纪念。
查看>>
Graphx处理janusGraph数据实现
查看>>
Oracle Study之案例--重建数据库控制文件
查看>>
log4j&slf4j日志框架入门
查看>>
五子棋精髓
查看>>
记一次升级Oracle驱动引发的死锁
查看>>
php加速器eaccelerator概述
查看>>
SER2012安装和激活终端激活
查看>>
JBoos 与 jetty
查看>>