0

我正在尝试从 PHP 连接到 .me 注册商 EPP OT&E 服务器,但没有成功。我正在使用 php-epp 库(https://github.com/centralnic/php-epp),但问题是我无法打开连接。

我可以使用以下命令打开连接(或至少看起来如此):

openssl s_client -connect ote1.meregistry.net:700 -cert certificate.crt -key privateKey.key -CAfile PCA-3.pem -showcerts -state

返回:

已连接(00000003)

SSL_connect:在/连接初始化之前

SSL_connect:SSLv2/v3 写客户端 hello A

如何在 PHP 中重现此命令?我试过这个没有成功:

 $context = stream_context_create();
 stream_context_set_option($context, 'ssl', 'local_cert', 'pemcertificate.pem');
 stream_context_set_option($context, 'ssl', 'passphrase', '');
 stream_context_set_option($context, 'ssl', 'cafile', 'PCA-3.pem');
 stream_context_set_option($context, 'ssl', 'verify_peer', false);
 stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
 $epp = new Net_EPP_Client();
 echo "\nConnecting..";
 $epp->connect('ote1.meregistry.net', 700, 20, true, $context);

我收到此错误:

stream_socket_client():SSL 操作失败,代码为 1。OpenSSL 错误消息:错误:14094410:SSL 例程:SSL3_READ_BYTES:sslv3 警报握手失败

有什么建议吗?

谢谢

4

1 回答 1

2

我发现了问题:我使用的证书无效。

此外,对于某些服务器,命令 openssl s_client 需要一个标志-no_tls1以允许命令正确执行。

希望它对其他人有用!

于 2013-07-26T04:13:21.950 回答