0

我需要通过他们的 EPP API 与 .NL 注册商 - sidn.nl 合作。我使用标准的 EPP HELLO,添加 4 个字节的消息大小(大端),调用 CURL - 没有标题,没有数据返回。代码:

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 问候语。他们的技术支持没用,给我发了标准手册的链接:-)

提前感谢您的任何帮助/建议!

更新:通过 TCP(而不是 CURL)调用时,结果几乎相同:

   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

服务器没有返回数据,连接正在关闭

4

1 回答 1

0

通过使用 tls 而不是 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);
});

收到 EPP 问候

于 2017-02-24T11:31:40.637 回答