Metaregistrar EPP documentation

EPP Connections

This is a primer on setting up epp connections. Epp connectons can be made over several types of protocols. The two we will be discussing are TCP and SSL. The SSL version is just a TCP connection wrapped inside SSL encryption.

For ease of use please use the Metaregistrar epp client

So how do you set up a connection

Basically connect on ssl://hostname-here:7000

Port 7000 has been reserved for SSL epp connections. Our servers only support SSL connections.

The protocol

The protocol uses a 4 byte un signed long big endian byte order marker ahead of any message to indicate message length.

The following php code adds the long integer to the message

function addInteger($content) { $int = pack('N', intval(strlen($content) + 4)); return $int . $content; }

To read the length of a message you can use the following php code function readInteger($content) { $int = unpack('N', substr($content, 0, 4)); return $int[1]; }

In essence the messages being sent to and from are: [length]<?xml version="1.0" encoding="UTF-8" standalone="no"?><epp xmlns="urn:ietf:params:xml:ns:epp-1.0"> <hello/> </epp>

Determining which response is for which command you sent

You use the<clTRID>asdfghjkl</clTRID> element to determine which response belongs to which command you sent. They will always be sent back on the same connection. You will also receive a <svTRID> element. This will be a unique hash for the command that has been created by the server.

Some like the Hello command

But it is better to send a command and wait for the response to be sure you received the right response. This is basically what the "writeandread" method in our php-epp-client's eppConnection class does.

Command timeouts

A command will automatically time out after 60 seconds. It may or may not have failed or just taken a very long time. Please verify if the command was completed before continuing.