2017-02-22 51 views
0

我需要.NL登记处的工作 - sidn.nl - 通过他们的EPP API。我使用标准EPP HELLO,添加4个字节的消息大小(大端),调用CURL - 无标题,无数据返回。代码:EPP服务器不响应EPP HELLO

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(); 

我的IP在控制面板中被列入白名单。

为什么它不响应?它应该是EPP GREETING。 他们的技术支持也没用,发过来链接到标准手动:-)

预先感谢任何帮助/咨询!

UPDATE:当通过TCP(而不是卷曲)调用的结果几乎是相同的:

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'); 
    }); 

传出请求:

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 

服务器返回的数据,连接被在第二秒关闭

回答

0

使用tls代替网络解决:

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); 
}); 

收到EPP问候