ssl - 节俭 ssl python 服务器

标签 ssl ssl-certificate thrift

我想保护 thrift 服务器(只是加密,并将使用 acl 进行简单的身份验证),发现这个:http://architects.dzone.com/articles/how-secure-and-apache-thrift,但代码是用 Java 编写的,我的 thrift 服务器是用 Python 编写的。我在 Google 上搜索了很多,但对此却一无所获。

我已成功运行 go version:

var transport thrift.TServerTransport
var err error
cfg := new(tls.Config)
if cert, err := tls.LoadX509KeyPair("server.crt", "server.key"); err == nil {
    cfg.Certificates = append(cfg.Certificates, cert)
} else {
    return err
}
transport, err = thrift.NewTSSLServerSocket(addr, cfg)

虽然在 Python 中没有运气:

from thrift.transport import TSSLSocket
transport = TSSLSocket.TSSLServerSocket(host, port, certfile="server.pem")

我不知道server.pem,它与server.key和server.crt有关吗?

最佳答案

这些文件都位于/test/keys 下.

原因是它们应该被多种(所有)语言使用,所以它们被移到了一个专门的文件夹中。由于它本质上是测试数据,所以它是 /test/keys

关于ssl - 节俭 ssl python 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31135946/

相关文章:

java - 如何在整个应用程序中访问 Guice 注入(inject)器

ssl - 安装了 SSL 证书,但仍然暴露于中间人攻击

google-app-engine - Google App Engine 上的 SSL 证书无法正常工作

java - 有谁知道如何在 Java 中使用没有 keystore 的 StartCom SSL 或使用自定义 keystore ?

SSL 证书显示颁发者 [颁发者] 作为 mydomain

c - Thrift:是否可以仅使用 C(GLib)Thrift 库进行序列化?

python - 为 python 设置 Thrift 模块时出错

apache - http 到 https 给出重定向循环错误

apache - 静态IP地址,SSL证书,万恶之源

dns - cert-manager DNS01 挑战失败 - 找不到通配符域的区域