metaregistrar / php-epp-client

Object-oriented PHP EPP Client
https://www.metaregistrar.com/docs/
MIT License
213 stars 156 forks source link

RRPproxy connection DNSSEC problem #95

Closed sburina closed 7 years ago

sburina commented 7 years ago

Hello!

I've notced that RRPproxy connection uses the default eppInfoDomainResponse, which returns an error when calling getKeydata method:

Trying to get property of non-object in /vendor/metaregistrar/php-epp-client/Protocols/EPP/eppResponses/eppInfoDomainResponse.php on line 265

I've also found out that Metaregistrar\EPP\atEppInfoDomainResponse works correctly for this registrar.

Could you please update the RRPproxy connection constructor to include:

parent::addCommandResponse('Metaregistrar\EPP\eppInfoDomainRequest', 'Metaregistrar\EPP\atEppInfoDomainResponse');

.. to save some head-banging hours for other developers? :)

Thank you!

metaregistrar commented 7 years ago

Hi,

Using atEppInfoDomainResponse will work, but is not really how it should work.

I will add the correct infodomainresponse to the dnssec extension of php-epp-client

sburina commented 7 years ago

Hello, and thanks for the response! :) Yes, in the meantime I've noticed another problem - if you have 4 DS records defined, getKeydata returns an array of four records containing exactly the same data from the first record.

foreach ($result as $keydata) {
                    $secdns = new eppSecdns();
                    $secdns->setKeytag($result->item(0)->getElementsByTagName('keyTag')->item(0)->nodeValue);
                    $secdns->setAlgorithm($result->item(0)->getElementsByTagName('alg')->item(0)->nodeValue);
                    $secdns->setDigestType($result->item(0)->getElementsByTagName('digestType')->item(0)->nodeValue);
                    $secdns->setDigest($result->item(0)->getElementsByTagName('digest')->item(0)->nodeValue);
                    $keys[] = $secdns;
                }

$result->item(0) always targets the first element. I made it work by changing each line like so:

$secdns->setKeytag($keydata->getElementsByTagName('keyTag')->item(0)->nodeValue);

metaregistrar commented 7 years ago

I have added your change and also added the change to the enableDnssec() option so you do not need atInfoResponse any more.

sburina commented 7 years ago

Thank you once again, this was extremely quick! :)