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. BZOJ 2693: jzptab( 莫比乌斯反演 )

    速度居然#2...目测是因为我没用long long.. 求∑ lcm(i, j) (1 <= i <= n, 1 <= j <= m) 化简之后就只须求f(x) = x∑u( ...

  2. Linux下安装配置词典GoldenDict

    GoldenDict   apt-get install goldendict 安装完成以后,需要自己手动加入字典,增加在线翻译网址(例如,有道,金山等),点击 编辑--dictionaries  完 ...

  3. tomcat下部署activemq(转)

    转自:http://marshal.easymorse.com/archives/1414 activemq可以单独部署和执行,比如类似ActiveMQ的最简单应用中提到的安装和执行方式.但是有时候需 ...

  4. Spring Cloud Config

    Spring Cloud Config provides server and client-side support for externalized configuration in a dist ...

  5. pthread_setschedprio()函数详解!!!

    pthread_setschedprio() Set a thread's priority 用于设置现成的优先级 包含在头文件 #include <pthread.h> 用法:int p ...

  6. Ubuntu下使用sshfs挂载远程目录到本地(和Windows挂载盘一样)

    访问局域网中其他Ubuntu机器,在不同机器间跳来跳去,很是麻烦,如果能够把远程目录映射到本地无疑会大大方面使用,就像Windows下的网络映射盘一样.在Linux的世界无疑也会有这种机制和方式,最近 ...

  7. javascript 精典案例分析一览

    1.[优雅代码]深入浅出 妙用Javascript中apply.call.bind http://www.cnblogs.com/coco1s/p/4833199.html 2.1.0.1 ionic ...

  8. 获取字符宽度:并非自适应。coretext去计算

    获取字符宽度:并非自适应.coretext去计算 UniChar ch = [ns_str characterAtIndex:0]; CGGlyph glyph = 0; CTFontGetGlyph ...

  9. QNX系统-关于delay函数与sleep函数的区别

    QNX是类unix系统.在c语言编程过程中,往往会用到delay或者sleep延时函数.两者之间在使用上有一定的区别!!! delay()是循环等待,该进程还在运行,占用处理器. sleep()不同, ...

  10. 由于“Table(T_Test)”没有主键,因此无法在其上执行 Create、Update 或 Delete 操作

    在使用Linq To Sql查询的时候,遇到这么个问题,如图所示: 出现这个问题的原因就像途中所说的——没有主键(现在终于初步知道“为什么别人常说数据库中的逻辑主键是为了在编程中方便使用”的原因了,估 ...