schemacs
schemacs

Reputation: 2891

thrift ssl python server

I want to secure the thrift server(just encrypt, and will use acl to do the simeple authentication), and found this: http://architects.dzone.com/articles/how-secure-and-apache-thrift , but the code is in Java, My thrift server is in Python. I have searched a lot on Google, but found little on this.

I have run the go version successfully:

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)

while no luck in Python :

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

I have no idea of server.pem, is it related with server.key and server.crt?

Upvotes: 0

Views: 1237

Answers (1)

JensG
JensG

Reputation: 13421

These files are all located under /test/keys.

The reason is that they are supposed to be used by multiple (all) languages, so they have been moved into a dedicated folder. Since it is essentially test data, it is /test/keys.

Upvotes: 1

Related Questions