当前位置: 动力学知识库 > 问答 > 编程问答 >

php - EPP connection timeout on remote server, works on Wamp

问题描述:

I'm trying to connect to an EPP-server with PHP, and it's all working on the Wampserver (PHP 5.5.12) on my pc. I've written a class and connect with this piece of code:

 if(!$this->socket = stream_socket_client('tls://'.$this->host.':'.$this->port, $errno, $errstr, 10, STREAM_CLIENT_CONNECT)){

return false;

}

But when I try the same class on my remote webserver (PHP 5.3.10), it gives a "Connection timed out" error. The ip-address is whitelisted at the registry, so this shouldn't be the problem.

I figured out that the problem might be the SSL-settings, but I expected another error if that's the case. I've already tried:

 $fc = stream_context_create(array('ssl' => array('verify_peer' => false)));

if(!$this->socket = stream_socket_client('tls://'.$this->host.':'.$this->port, $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $fc)){

return false;

}

And

 $fc = stream_context_create(array('ssl' => array('allow_self_signed' => true, 'local_cert' => 'client.pem')));

if(!$this->socket = stream_socket_client('tls://'.$this->host.':'.$this->port, $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $fc)){

return false;

}

But I keep getting the "Connection timed out" error. Any thoughts about this?

分享给朋友:
您可能感兴趣的文章:
随机阅读: