EPP 服务器不响应 EPP HELLO
EPP server does not respond to EPP HELLO
我需要与 .NL 注册商合作 - sidn.nl - 通过他们的 EPP API。我使用标准 EPP HELLO,添加 4 字节消息大小(大端),调用 CURL - 没有 header,没有数据返回。代码:
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。
他们的技术支持没用,让我 link 到标准手册 :-)
在此先感谢您的帮助/建议!
UPDATE:通过 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
服务器returns无数据,连接即将关闭
已通过使用 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 问候语
我需要与 .NL 注册商合作 - sidn.nl - 通过他们的 EPP API。我使用标准 EPP HELLO,添加 4 字节消息大小(大端),调用 CURL - 没有 header,没有数据返回。代码:
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。 他们的技术支持没用,让我 link 到标准手册 :-)
在此先感谢您的帮助/建议!
UPDATE:通过 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
服务器returns无数据,连接即将关闭
已通过使用 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 问候语