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. 基于visual Studio2013解决C语言竞赛题之1043求末尾0个数

       题目 解决代码及点评 /* 43. 求n!的末尾有多少个零.可以通过检查n!含有多少个10的因数来求它末尾零的个数. 因为10=2×5,在n!中含有2的因数显然多于含有5的因数. 一 ...

  2. 公交线路免费api接口代码

    描写叙述:本接口主要是依据城市名称 +  线路名称 模糊查找城市公交线路信息. 开源api接口:http://openapi.aibang.com/bus/lines?app_key=keyvalue ...

  3. Hadoop SequenceFile

    SequenceFile格式: 每一个SequenceFile都包含一个“头”(header).Header包含了以下几部分. 1.SEQ三个字母的byte数组 2.Version number的by ...

  4. android的单元测试

    1.新建android Test project 2. 选择针对测试的项目 3.新建类继承AndroidTestCase即可: package com.howlaa.sms.test; import ...

  5. 树——axure线框图部件库介绍

    终于到最后一个组件的介绍了!到这里基础的应用应该算完成了!  1. 拖动树组件,到页面编辑区域  2.添加节点,可以添加子节点也可以在该节点的前后添加平级节点  3. 编辑节点图标 做好上面的那一步, ...

  6. 水平线、垂直线——axure线框图部件库介绍

    1. 将水平线.垂直线拖动到axure页面编辑区域,如图:  2. 水平线.垂直线相关属性设置 主要属性有.线条的颜色.粗细.线条的样式.箭头的样式 来自:非原型不设计

  7. 也谈基于NodeJS的全栈式开发(基于NodeJS的前后端分离)

    前言 为了解决传统Web开发模式带来的各种问题,我们进行了许多尝试,但由于前/后端的物理鸿沟,尝试的方案都大同小异.痛定思痛,今天我们重新思考了“前后端”的定义,引入前端同学都熟悉的NodeJS,试图 ...

  8. poj 2126 Factoring a Polynomial 数学多项式分解

    题意: 给一个多项式,求它在实数域内的可分解性. 分析: 代数基本定理. 代码: //poj 2126 //sep9 #include <iostream> using namespace ...

  9. 从注册流程 分析如何安全退出多个Activity 多种方式(附DEMO)

    前言   由于一个同学问到我如何按照一个流程走好之后回到首页,我以前看到过4个解决方案,后来发现有做个记录和总结的必要,就写了这篇博文.(之前看小强也写过一篇,这里通过自身的分析完整的总结一下以下6种 ...

  10. Android 高仿 频道管理----网易、今日头条、腾讯视频 (可以拖动的GridView)附源码DEMO

    距离上次发布(android高仿系列)今日头条 --新闻阅读器 (二) 相关的内容已经半个月了,最近利用空闲时间,把今日头条客户端完善了下.完善的功能一个一个全部实现后,就放整个源码.开发的进度就是按 ...