Installing SSL on CentOS | My Virtual Time Capsule
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的更多相关文章
- Installing Mp4box in centos 6
Installing Mp4box in centos 6 Installing Mp4box in centos 6Login to the server cd /usr/local/src/ ...
- 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 ...
- Installing Jenkins to Centos Docker
1.Install Docker CE to Centos7 [root@zoo1 ~]# yum install -y yum-utils device-mapper-persistent-data ...
- Virtual Box + CentOS Minimal + Apache搭建Web服务器
本文并不介绍关于Virtual Box, CentOS, Apache的安装, 主要针对安装后相关的配置, 使宿主机(Host)可以访问客户机(Guest: CentOS in Virtual Box ...
- 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.安装 ...
- 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 ...
- 在 CentOS 7上Virtualbox+phpVirtualBox完整虚拟化环境部署
一.phpVirtualBox简介 VirtualBox是一套为不同操作系统而设的 x86 虚拟化产品.它是一个机器/硬件的虚拟化产品,功能上与 VMware Server.Parallel ...
- centos apache2.4.6 apache https配置
错误描述: SSL 接收到一个超出最大准许长度的记录. 错误代码:SSL_ERROR_RX_RECORD_TOO_LONG 原因: root@iZwz93telmwbh624e5zetqZ:~# ap ...
- 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 查看硬 ...
随机推荐
- cocos2d-x环境的搭建之xcode-本人亲历成功搭建!
cocos2d-x环境的搭建之xcode-本人亲历成功搭建! 写给大家的前言,在学习cocos2d-x的时候自己走了很多的弯路,也遇到了很多很多问题,不管是简单的还是困难的现在都慢慢的一步一步克服了, ...
- 使用C语言实现字符串中子字符串的替换
描述:编写一个字符串替换函数,如函数名为 StrReplace(char* strSrc, char* strFind, char* strReplace),strSrc为原字符串,strFind是待 ...
- Android中获取网页表单中的数据
MainActivity如下: package cn.testjavascript; import java.util.StringTokenizer; import android.os.Bundl ...
- NSUserDefaults设置bool值重新启动后bool仅仅设置丢失问题
今天使用NSUserDefaults保存bool至重新启动后发现bool值没有保存对 NSUserDefaults *ud = [NSUserDefaults standardUserDefaults ...
- c++实现atoi()和itoa()函数(字符串和整数转化)
(0) c++类型所占的字节和表示范围 c 语言里 类型转换那些事儿(补码 反码) 应届生面试准备之道 最值得学习阅读的10个C语言开源项目代码 一:起因 (1)字符串类型转化为整数型(Integer ...
- SDUT 2893-B(DP || 记忆化搜索)
B Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描写叙述 有n块地板排成一条直线,从左到右编号为1,2,3. . . n-1,n,每 ...
- listbox多选实现上下移动 js版和服务器版
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="X200906021128.as ...
- [每日一题] OCP1z0-047 :2013-08-28 DELETE..........................................................160
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/10475707 正确答案:ACD 根据题库,操作如下: A答案能删除: oe@OCM> ...
- Swift - 设置网格UICollectionView的单元格间距
要设置单元格cell的间距(水平间距,垂直间距)可进行如下设置: 方法1:在storyboard中设置 选择Collection View后在面板里设置Min Spacing相关属性(这里也可以设置单 ...
- 十天学习PHP之第三天
1)按右边的结构:查看改动表结构 2)按右边的浏览:查看表中的数据 3)按右边的SQL:执行SQL语句 4)按右边的插入:插入一行记录 5)按右边的清空:删除表中全部记录 6)按右边的删除: ...