Hello folks

I have a simple Thrift server that utilizes TLS. I was using sample code
and it works fine

protocolFactory := thrift.NewTBinaryProtocolFactoryDefault()
transportFactory := thrift.NewTBufferedTransportFactory(8192)
transport, err := thrift.NewTSSLServerSocket(ADDRESS, tlsConf)
handler := &MyHandler{}
processor := my.NewMyProcessor(handler)
server := thrift.NewTSimpleServer4(processor, transport, transportFactory,
protocolFactory)

I see a client (also written in Go) can connect the server and call
following function:

func (p *MyHandler) GetKey(ctx context.Context, req *KeyRequest) (resp
*KeyResponse, err error) {
return nil, &KeyNotFound{}
}

In my handler function I want to get information about client's certificate
to get its id. And I need to get
https://golang.org/pkg/crypto/tls/#Conn.ConnectionState struct from
Connection object.

So my question - how do I get access to TLS connection info from my
handler. I was trying to google but did not find any good examples on this
topic.

Reply via email to