metaregistrar / php-epp-client

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

getKeyData error #119

Closed paulhermanseu closed 6 years ago

paulhermanseu commented 6 years ago

Our implementation with SIDN stopped working I believe since we updated metaregistrar/php-epp-client metaregistrar/php-epp-client (1.0.3 => 1.0.4)

When we try to get DNSSEC keys with: $response->getKeyData()

We get this error:

Trying to get property of non-object', '/path/to/vendor/metaregistrar/php-epp-client/Protocols/EPP/eppExtensions/secDNS-1.1/eppResponses/eppDnssecInfoDomainResponse.php', 19, array('xpath' => object(DOMXPath), 'result' => object(DOMNodeList), 'keys' => array(), 'keydata' => object(DOMElement), 'secdns' => object(eppSecdns))) in eppDnssecInfoDomainResponse.php (line 19)

Do you know what's wrong here?

metaregistrar commented 6 years ago

I will test this and bring out a fix. Problem with keydata is that you have 2 options, get the keys or get the DS data. Some registries work with the keys, some with the DS data.

But the function should not give an error.

In the mean time, can you test if $response->getKeys(); does work for you?

metaregistrar commented 6 years ago

I have committed a fix that sees if either keyData or dsData are present. If not, the function getKeys() or getKeydata() will return an empty array.

For SIDN, please make sure to use the getKeys() options, not getKeydata, because the domain:info from SIDN will return the key data.

paulhermanseu commented 6 years ago

How do I test this fix, I tried to do a composer update but we allready have the latest version. Do I have to manually replace the files?

metaregistrar commented 6 years ago

If you have the latest version then you should have this update. It depends on how you have instructed composer to handle the versions. There is no version number attached to this update yet, so you will have to instruct composer to get the latest dev version instead of the latest stable version.

If this patch (and other changes) have proven themselves they become a stable version.

paulhermanseu commented 6 years ago

Using getKeys() instead of getKeyData() works!

getKeyData now returns an empty array, but before the update getKeyData returned the keys.

When should we use getKeys() and when should we use getKeyData()? Should we build a check per registry to find out which one is returning the keys?

metaregistrar commented 6 years ago

It depends per registry. There are 2 ways of submitting and reading DNSSEC keys from the registry, and every registry takes one of these 2. So as long as you stay with the same registry, you should be safe.

https://tools.ietf.org/html/rfc5910#section-5.1.2 The registry kan return <secDNS:dsData> elements or <secDNS:keyData> elements.