metaregistrar / php-epp-client

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

checkdomain w/ DOMDocument Error #35

Closed c42759 closed 8 years ago

c42759 commented 8 years ago

After config the settings.ini, I try to run (php 7.0) the checkdomain on Examples folder, but this error appears,

php ./infodomain.php google.com
Retrieving info on google.com
PHP Fatal error:  Class 'DOMDocument' not found in /opt/lampp/htdocs/epp/Protocols/EPP/eppResponses/eppResponse.php on line 9

but with php 5.6

/opt/lampp/bin/php ./infodomain.php google.com
Retrieving info on google.com
Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /opt/lampp/htdocs/epp/Protocols/EPP/eppConnection.php on line 371
Warning: fsockopen(): Failed to enable crypto in /opt/lampp/htdocs/epp/Protocols/EPP/eppConnection.php on line 371
Warning: fsockopen(): unable to connect to ssl://eppdev.dns.pt:3121 (Unknown error) in /opt/lampp/htdocs/epp/Protocols/EPP/eppConnection.php on line 371
ERROR: Writing while no connection is made is not supported.

BR

metaregistrar commented 8 years ago

Hi ,

I have not tested the php-epp-client with PHP version 7. Was not aware that DOMDocument has changed and i will test that asap

The second error message, with php 5.6, is kind of normal if you cannot get a connection to the registry. To see the errors in your connection, enable logging like this: if ($conn = eppConnection::create('XXXX.INI',true)) (infodomain.php line 27)

c42759 commented 8 years ago

After that change, the command run, but show a few new errors about the crypto,

 /opt/lampp/bin/php ./infodomain.php critec.pt
Retrieving info on critec.pt
Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /opt/lampp/htdocs/epp/Protocols/EPP/eppConnection.php on line 371
Warning: fsockopen(): Failed to enable crypto in /opt/lampp/htdocs/epp/Protocols/EPP/eppConnection.php on line 371
Warning: fsockopen(): unable to connect to ssl://eppdev.dns.pt:3121 (Unknown error) in /opt/lampp/htdocs/epp/Protocols/EPP/eppConnection.php on line 371
ERROR: Writing while no connection is made is not supported.
==== LOG ====
-----ERROR-----2016-05-31 12:01:42-----
Connection could not be opened: 0
-----END-----2016-05-31 12:01:42-----
-----WRITE-----2016-05-31 12:01:42-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" xmlns:host="urn:ietf:params:xml:ns:host-1.0" xmlns:polldata="http://www.metaregistrar.com/epp/polldata-1.0" xmlns:command-ext="http://www.metaregistrar.com/epp/command-ext-1.0" xmlns:ext="http://www.metaregistrar.com/epp/ext-1.0">
  <command>
    <login>
      <clID>CLRD-209103-FCCN</clID>
      <pw><![CDATA[Passw0rd]]></pw>
      <options>
        <version>1.0</version>
        <lang>en</lang>
      </options>
      <svcs>
        <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
        <svcExtension>
          <extURI>http://www.metaregistrar.com/epp/polldata-1.0</extURI>
          <extURI>http://www.metaregistrar.com/epp/command-ext-1.0</extURI>
          <extURI>http://www.metaregistrar.com/epp/ext-1.0</extURI>
        </svcExtension>
      </svcs>
    </login>
    <clTRID>574d6106377be</clTRID>
  </command>
</epp>
-----END-----2016-05-31 12:01:42-----
-----WRITE-----2016-05-31 12:01:42-----
Writing: 973 + 4 bytes
-----END-----2016-05-31 12:01:42-----
metaregistrar commented 8 years ago

Can you try to connect with eppdev.dns.pt port 3121 instead of ssl://eppdev.dns.pt port 3121?

See if that works.

c42759 commented 8 years ago

In that way works, but I'm disconnected without the info about the domain,

/opt/lampp/bin/php ./infodomain.php critec.pt
Retrieving info on critec.pt
ERROR: Unexpected closed connection by remote host...
==== LOG ====
-----CONNECT-----2016-05-31 12:09:58-----
Connection made
-----END-----2016-05-31 12:09:58-----
-----WRITE-----2016-05-31 12:10:08-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" xmlns:host="urn:ietf:params:xml:ns:host-1.0" xmlns:polldata="http://www.metaregistrar.com/epp/polldata-1.0" xmlns:command-ext="http://www.metaregistrar.com/epp/command-ext-1.0" xmlns:ext="http://www.metaregistrar.com/epp/ext-1.0">
  <command>
    <login>
      <clID>CLRD-209103-FCCN</clID>
      <pw><![CDATA[Passw0rd]]></pw>
      <options>
        <version>1.0</version>
        <lang>en</lang>
      </options>
      <svcs>
        <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
        <svcExtension>
          <extURI>http://www.metaregistrar.com/epp/polldata-1.0</extURI>
          <extURI>http://www.metaregistrar.com/epp/command-ext-1.0</extURI>
          <extURI>http://www.metaregistrar.com/epp/ext-1.0</extURI>
        </svcExtension>
      </svcs>
    </login>
    <clTRID>574d63000115c</clTRID>
  </command>
</epp>
-----END-----2016-05-31 12:10:08-----
-----WRITE-----2016-05-31 12:10:08-----
Writing: 973 + 4 bytes
-----END-----2016-05-31 12:10:08-----
-----DISCONNECT-----2016-05-31 12:10:18-----
Disconnected
-----END-----2016-05-31 12:10:18-----
metaregistrar commented 8 years ago

I don't think this way works, because you get ERROR: Unexpected closed connection by remote host...

This means that the host does not accept this connection.

I tried to find documentation for eppdev.dns.pt but they do not have it on their public website. So i do not know which kind of certificate they are using.

If i try "openssl s_client -connect eppdev.dns.pt:3121" i get these error messages from openssl: depth=0 /C=PT/L=Lisboa/O=Associa\xC3\xA7\xC3\xA3o DNS.PT/OU=Certificado SSL/TLS/CN=registo.dns.pt verify error:num=20:unable to get local issuer certificate verify return:1 depth=0 /C=PT/L=Lisboa/O=Associa\xC3\xA7\xC3\xA3o DNS.PT/OU=Certificado SSL/TLS/CN=registo.dns.pt verify error:num=27:certificate not trusted verify return:1 depth=0 /C=PT/L=Lisboa/O=Associa\xC3\xA7\xC3\xA3o DNS.PT/OU=Certificado SSL/TLS/CN=registo.dns.pt verify error:num=21:unable to verify the first certificate verify return:1

It seems that they are using a self-signed certificate

c42759 commented 8 years ago

I have all doc here, but it's all in PORTUGUESE

ProtocoloEPP_v2.7_pt.pdf

metaregistrar commented 8 years ago

I have created Registries/ptEppConnection for you

if you fill in userid and password in pt.ini and you use if ($conn = eppConnection::create('../Registries/ptEppConnection/pt.ini',true)) {

Then my script is able to login fine, but then you get a different error when doing infodomain, because DNS.PT expects extra info on the domain:info command: <ptdomain:info xmlns:ptdomain="http://eppdev.dns.pt/schemas/ptdomain-1.0" xsi:schemaLocation="http://eppdev.dns.pt/schemas/ptdomain-1.0 ptdomain-1.0.xsd"> ptdomain:roid2221881/ptdomain:roid /ptdomain:info

This alteration of the domain:info command is not yet programmed in php-epp-client.

metaregistrar commented 8 years ago

I have added ptinfodomain extension for your reference about how to create an extension for DNS.PT

Please download the latest version for this.

c42759 commented 8 years ago

Now just need to change infodomain.php:7 from use Metaregistrar\EPP\eppInfoDomainRequest; to use Metaregistrar\EPP\ptEppInfoDomainRequest; , right?

metaregistrar commented 8 years ago

That is correct. It still does not work, though. I do not know why, maybe you can ask the guys from DNS.PT what is wrong.

There is an example infodomain.php script for you in the Registries/ptEppConnection directory

c42759 commented 8 years ago

They say only have connections between 12:30 and 13:30, :s , I send them another report.

c42759 commented 8 years ago

They are telling me my username aren't asking nothing to the server. In some way, yesterday on ur tests works, but not for me.

Maybe because I'm using a local VPS?

metaregistrar commented 8 years ago

I do not know why it does not work from your machine, only that i do not have any problems here. Maybe you can ask the guys of DNS.PT if they see activity on their side

ismael-miguel-liderlink commented 3 years ago

I know this is an old issue, but, for anyone having troubles with this exact error, you should try:

This solved the issue for me.

Also, make sure that you use the following settings (for development):