Search code examples
dnsregistrarepp

EPP server does not respond to EPP HELLO


I need to work with .NL registrar - sidn.nl - through their EPP API. I use standard EPP HELLO, add 4 bytes message size (big endian), call CURL - no header, no data back. Code:

var epp_hello = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'+
    '<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">'+
    '    <hello/>'+
    '</epp>'; // EPP HELLO
var xml = bigEndian(epp_hello)+""; // big endian
curl.setOpt(Curl.option.URL, "drs.domain-registry.nl"); 
curl.setOpt(Curl.option.PORT, 700); 
curl.setOpt(Curl.option.POST, 1);
curl.setOpt(Curl.option.HEADER, true);
curl.setOpt(Curl.option.POSTFIELDS, xml);
curl.setOpt(Curl.option.HTTPHEADER , ['Content-type: text/xml']);
curl.setOpt(Curl.option.TIMEOUT , 180);
curl.setOpt(Curl.option.SSL_VERIFYPEER, true); 
curl.setOpt(Curl.option.SSL_VERIFYHOST, false);   
curl.perform();  

My IP is whitelisted in control panel.

Why it responds nothing? It should be EPP GREETING. Their tech support is useless, sent me link to standard manual :-)

Thanks in advance for any help / advice!

UPDATE: When calling through TCP (instead of CURL) the result is pretty much the same:

   var epp_hello = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'+
                    '<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"><hello/></epp>'; 
    var xml = bigEndian(epp_hello); 
    var ddd = new Date();

    var client = new net.Socket();
    client.connect(700, "drs.domain-registry.nl", function(xxml) {
        console.log('Connected ' + ddd.toUTCString(),xxml);
        client.write(xxml);
    }.bind(null,xml));

    client.on('data', function(data) {
        console.log('Received: ' + data);
        client.destroy();
    });

    client.on('close', function() {
        console.log('Connection closed');
    });

Outgoing requests:

Connected Thu, 23 Feb 2017 01:55:48 GMT <Buffer 00 00 00 74 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 55 54 46 2d 38 22 20 73 74 61 6e 64 61 6c 6f 6e ... >
Connection closed
Connected Thu, 23 Feb 2017 01:55:52 GMT <Buffer 00 00 00 74 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 55 54 46 2d 38 22 20 73 74 61 6e 64 61 6c 6f 6e ... >
Connection closed
Connected Thu, 23 Feb 2017 01:55:56 GMT <Buffer 00 00 00 74 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 55 54 46 2d 38 22 20 73 74 61 6e 64 61 6c 6f 6e ... >
Connection closed

Server returns no data, connection is being closed in a second


Solution

  • Resolved by using tls instead of net:

    const epp_hello = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'+
                    '<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"><hello/></epp>'; 
    
    const opts = {
    };
    var xml = bigEndian(epp_hello); 
    var client = tls.connect(700, "drs.domain-registry.nl", opts, function(xxml) {
        client.write(xxml);
    }.bind(null,xml));
    
    client.on('data', function(data) {
        console.log('Received: ' + data);
    });
    

    Received EPP GREETING