thrift php客户端x509证书无法通过thrift csharp服务器验证X509Certificate

时间:2017-03-28 03:16:11

标签: c# php thrift x509

使用thrift php客户端和csharp服务器 我想要保护节俭的php客户端,我有一个客户端证书,例如e.g test.pem。 thrift php客户端代码:

$cer_key = file_get_contents("test.pem");
$cer = openssl_x509_read($cer_key); 
$socket = new TSSLSocket("server-host", 19140, $cer );

thrift csharp服务器验证码:

private bool DefaultClientCertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
        return sslPolicyErrors == SslPolicyErrors.None;
}

当我在服务器上调试时,cert为null,sslPolicyErrors为RemoteCertificateNotAvailable, 所以我没有得到客户证书。 但在thrift csharp客户端和服务器中同样的事情工作得很好。 如何在php客户端上发送x509类型证书,该证书可以通过Xsha9Certificate在csharp服务器上验证?

0 个答案:

没有答案