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. linux配置ssh+rsync

    ssh  远程登录 sftp    文件共享 类似ftp  ssh  secure file transfer client scp    文件共享 类似cp   ssh配置文件 /etc/ssh/s ...

  2. properties 文件的中文转ASCII

     在软件开发过程中,经常要涉及到多语言支持问题,常用的解决方案是将各个语言文字放到properties文件中,但中文是需要转为ASCII的 .那么如何将中文进行转换呢,下面就为你列举几种比较方便的方法 ...

  3. Hauntbox:用于控制你的自己主动化、电子创意家居的开源硬件盒子

    Hauntbox 是一个开源硬件控制器,能够满足用随意传感器和控制器建立复杂的.自己主动化的萦绕在心头的电子项目. 它不须要焊接或者预先学什么知识.是全然可控制.并与Arduino插板兼容. 无需编程 ...

  4. Swift - 判断设备方向(或监听设备方向的改变)

    通过UIDevice.currentDevice()来获取设备,可以取得设备当前的方向. 同时,我们可以添加一个通知来监听设备方向的变化,这样在开发中可以对不同的方向定制不同的排版布局界面. 下面通过 ...

  5. STM32学习之路-LCD(3)<显示图片>

    祝大家端午和六一快乐!原本今天是想歇息歇息的,可是实在无奈没什么事干.所以就来学习学习LCD显示图片的函数 函数是照搬奋斗的样例,算是些笔记吧.只是奋斗的样例凝视的不是非常具体.今天去看了正点原子的论 ...

  6. RHEL Server 6.3下MySQL5.5.25a源码安装

    OS:RHEL Server 6.3 MySQL:mysql-5.5.25a.tar.gz 相关依赖包: ncurses-5.9.tar.gz bison-2.5.tar.gz 安装MySQL 一.安 ...

  7. QTableWidget表格合并若干问题及解决方法

    Qt提供 QTableWidget作为表格的类以实现表格的基本功能,表格中所装载的每一个单元格由类QTableWidgetItem提供.这是基于表格实现 Qt提供的一个基础类,若想实现定制表格和单元格 ...

  8. tomcat 后台启动设置

    如果你环境变量配置对了且保证tomcat的bin目录下有如下三个文件,则你只需在cmd中运行 service install tomcat即可将tomcat添加的服务项中,然后在设置开机自动启动,则以 ...

  9. 基于visual Studio2013解决C语言竞赛题之1055排序

       题目 解决代码及点评 /* 功能:已知A是有30个元素的整型数组,编写一个对A[I1]到A[I2](I1≤I2)之间的元素排序的函数(从大到小排序) 请调用上述函数先将A[5]至A[ ...

  10. DRP分销系统总结

    上个月看完的分销系统的视频,用了漫长的时间看这个项目视频,能安慰自己的是不光是看视频了,还做了很多自己想做的事情,比如驾照拿下来了,比如参加了一些考试,比如讲了一些课程等等.把这个系统的总结总算是补上 ...