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

Installing SSL on CentOS | My Virtual Time Capsule的更多相关文章

  1. Installing Mp4box in centos 6

    Installing Mp4box in centos 6   Installing Mp4box in centos 6Login to the server cd /usr/local/src/ ...

  2. Installing pip on CentOS 7 for Python

    nstalling pip on CentOS 7 for Python 2.x On CentOS 7, you have to install setup tools first, and the ...

  3. Installing Jenkins to Centos Docker

    1.Install Docker CE to Centos7 [root@zoo1 ~]# yum install -y yum-utils device-mapper-persistent-data ...

  4. Virtual Box + CentOS Minimal + Apache搭建Web服务器

    本文并不介绍关于Virtual Box, CentOS, Apache的安装, 主要针对安装后相关的配置, 使宿主机(Host)可以访问客户机(Guest: CentOS in Virtual Box ...

  5. centos 6.5下安装mysql+nginx+redmine 3.1.0 笔记

    centos 6.5下安装mysql+nginx+redmine 3.1.0 笔记 目录[-] 过程 1.安装RVM 2.利用rvm安装 Ruby 1.9.3 并设为默认 3.安装rails 4.安装 ...

  6. Configure Puppet Master with Passenger and Apache on Centos

    What is Passenger? Passenger (AKA mod_rails or mod_rack) is an Apache 2.x module which lets you run ...

  7. 在 CentOS 7上Virtualbox+phpVirtualBox完整虚拟化环境部署

    一.phpVirtualBox简介      VirtualBox是一套为不同操作系统而设的 x86 虚拟化产品.它是一个机器/硬件的虚拟化产品,功能上与 VMware Server.Parallel ...

  8. centos apache2.4.6 apache https配置

    错误描述: SSL 接收到一个超出最大准许长度的记录. 错误代码:SSL_ERROR_RX_RECORD_TOO_LONG 原因: root@iZwz93telmwbh624e5zetqZ:~# ap ...

  9. Centos7 编译安装 Nginx PHP Mariadb Memcached 扩展 ZendOpcache扩展 (实测 笔记 Centos 7.3 + Mariadb 10.1.20 + Nginx 1.10.2 + PHP 7.1.0 + Laravel 5.3 )

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1611.iso 安装步骤: 1.准备 1.0 查看硬 ...

随机推荐

  1. encode_json 会对给定的Perl的数据结构转换为一个UTF-8 encoded, binary string.

    use JSON qw/encode_json decode_json/ ; use Encode; my $data = [ { 'name' => 'Ken' , 'age' => 1 ...

  2. 【视频】零基础学Android开发:蓝牙聊天室APP(四)

    零基础学Android开发:蓝牙聊天室APP第四讲 4.1 ListView控件的使用 4.2 BaseAdapter具体解释 4.3 ListView分布与滚动事件 4.4 ListView事件监听 ...

  3. Python 中的类的相关操作

    构造函数 构造函数是任何类都有的特殊方法.当要创建一个类时,就要调用构造函数.他的名字是__init__.init的前后分别是两个下划线.时间类Time的构造函数如下: >>> cl ...

  4. fzu 2035 Axial symmetry(枚举+几何)

    题目链接:fzu 2035 Axial symmetry 题目大意:给出n个点,表示n边形的n个顶点,判断该n边形是否为轴对称图形.(给出点按照图形的顺时针或逆时针给出. 解题思路:将相邻两个点的中点 ...

  5. WPF Popup 置顶问题

    原文 WPF Popup 置顶问题 问题: 使用wpf的popup,当在popup中弹出MessageBox或者打开对话框的时候,popup总是置顶,并遮住MessageBox或对话框. 解决: 写如 ...

  6. How to retreive raw post data from HttpServletRequest in java

    public static String getPostData(HttpServletRequest req) { StringBuilder sb = new StringBuilder(); t ...

  7. Poj 3771 hdu 3405

    poj 3771 http://poj.org/problem?id=3771 wiki Prim http://zh.wikipedia.org/wiki/%E6%99%AE%E6%9E%97%E5 ...

  8. 炮塔郝梦主solo

    尊重开发人员的工作,转载时请注明出处:http://blog.csdn.net/haomengzhu/article/details/31885287 或许你会由于它爱上dota: 或许你会由于它爱上 ...

  9. Servlet的学习之ServletContext(1)

    本篇来介绍Servlet中非常重要的对象,如ServletConfig类和ServletContext类,尤其是ServletContext类中的一些方法,本篇先讲述一部分,在下一篇中继续补充. 在对 ...

  10. Android switch 中 case expressions must be constant expressions 错误

    刚才导入android zxing 条码 的demo测试,发现出现如下错误 case expressions must be constant expressions 经检查,项目被设置成librar ...