Ceph RGW配置SSL

前期准备

已经成功部署了一套ceph集群,包括rgw对象存储,可以参考ceph官网的ceph-deploy进行部署。

开始配置SSL

生成证书

>> openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ceph-rgw-cert.key -out ceph-rgw.crt
>> cat ceph-rgw-cert.key >>ceph-rgw.crt

修改ceph.conf配置文件

如果是使用的ceph-deploy部署的ceph集群,修改如下

[client]
rgw frontends = civetweb port=172.16.50.166:6780+172.16.50.166:443s ssl_certificate=/ceph-rgw.crt

6780端口和443端口同时可用。

使用python boto库验证

安装boto库

>> pip install boto

代码如下

import ssl
import boto.s3.connection

try:
    _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
    pass
else:
    ssl._create_default_https_context = _create_unverified_https_context

access_key = ""
secret_key = ""
host = ""
port = 443

conn = boto.connect_s3(
    aws_access_key_id=access_key,
    aws_secret_access_key=secret_key,
    host=host,
    port=port,
    is_secure=True,
    validate_certs=False,
    calling_format=boto.s3.connection.OrdinaryCallingFormat()
)

container = "bucket01"

bucket = conn.get_bucket(bucket_name=container)
print(list(bucket.list()))
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值