Net::EPP::Client(3pm)
π Net::EPP::Client π
okay bestie, sit down, we're doing Net::EPP::Client today β a client library for the TLS transport of the Extensible Provisioning Protocol (EPP). Yes it's a Perl module, yes it's from the User Contributed Perl Documentation manual, and yes it is iconic actually. β¨
πΈ NAME πΈ
Net::EPP::Client β a client library for the TLS transport of the Extensible Provisioning Protocol (EPP).
the TLS transport: <https://www.rfc-editor.org/rfc/rfc5734.html> EPP itself: <https://www.rfc-editor.org/info/std69>
β¨ SYNOPSIS β¨
no cap, here's the whole vibe:
#!/usr/bin/perl
use Net::EPP::Client;
use strict;
my $epp = Net::EPP::Client->new('host' => 'epp.nic.tld');
my $greeting = $epp->connect;
$epp->send_frame('login.xml');
my $answer = $epp->get_frame;
my $answer = $epp->request('<epp><logout /></epp>');
π¦ DESCRIPTION π¦
So. RFC 5743 (linked right here: <https://www.rfc-editor.org/rfc/rfc5734.html>) defines a TCP- (and TLS-) based transport model for EPP, and this module is a client for that model. You can establish and manage EPP connections, and send and receive responses over that connection. That's the whole gig. π
Important reality check: Net::EPP::Client is a low-level EPP client. If you're out here writing actual applications, you should be using Net::EPP::Simple instead. fr fr. this one is for when you want to get your hands dirty.
π CONSTRUCTOR π
my $epp = Net::EPP::Client->new(%PARAMS);
This method creates a brand new EPP client object, main character energy from the jump. It accepts a bunch of parameters:
hostβ MANDATORY. Specifies the computer to connect to. This may be a DNS hostname or an IP address. If a hostname is provided, IPv6 will be used if available. πportβ OPTIONAL. Specifies the TCP port to connect to. This defaults to700.sslβ OPTIONAL. If the value of this parameter is false, then a plaintext connection will be created. Otherwise,IO::Socket::SSLwill be used to provide an encrypted connection. πframesβ DEPRECATED. If the value of this parameter is false, then therequest()andget_frame()methods (see below) will return strings instead ofNet::EPP::Frame::Responseobjects. like... we don't do that anymore bestie, but okay.
π METHODS π
π CONNECTING TO A SERVER π
my $greeting = $epp->connect(%PARAMS);
This method establishes the TCP connection. You can use the %PARAMS hash to specify arguments that will be passed on to the constructors for IO::Socket::IP (such as a timeout) or IO::Socket::SSL (such as certificate information). Which of these modules will be used is determined by the ssl parameter that was provided when instantiating the object. See the relevant manpage for examples. π
β οΈ This method willcroak()if connection fails, so be sure to useeval()if you want to catch the error. no sneaky uncaught dying allowed.
By default, the return value for connect() will be the EPP <greeting> frame returned by the server. Please note that the same caveat about blocking applies to this method as to get_frame() (see below). π
If you want to get the greeting yourself, set $params{no_greeting} to 1.
If TLS is enabled, then you can use %params to configure a client certificate and/or server certificate validation behaviour. π§
πΈ COMMUNICATING WITH THE SERVER πΈ
my $answer = $epp->request($question);
This is a simple wrapper around get_frame() and send_frame() (see below). This method accepts a question frame as an argument, sends it to the server, and then returns the next frame the server sends back. it's giving convenience, it's giving one-liner, we love her. π«Ά
β GETTING A FRAME FROM THE SERVER β
my $frame = $epp->get_frame;
This method returns an EPP response frame from the server. This will be a Net::EPP::Frame::Response object unless the frames argument to the constructor was false, in which case it will be a string containing a blob of XML.
Important Note: this method will block your program until it receives the full frame from the server. That could be a bad thing for your program, so you might want to consider using the alarm() function to apply a timeout, like so:
my $timeout = 10; # ten seconds
eval {
local $SIG{ALRM} = sub { die "alarm\n" };
alarm($timeout);
my $frame = $epp->get_frame;
alarm(0);
};
if ($@ ne '') {
alarm(0);
print "timed out\n";
}
If the connection to the server closes before the response can be received, or the server returned a mal-formed frame, this method will croak(). π
π SENDING A FRAME TO THE SERVER π
$epp->send_frame($frame);
This sends a request frame to the server. $frame may be one of:
- a scalar containing XML
- a scalar containing a filename
- an
XML::LibXML::Documentobject (or an instance of a subclass) - an
XML::DOM::Documentobject (or an instance of a subclass)
pick your fighter, all four are valid. π
π DISCONNECTING FROM THE SERVER π
$epp->disconnect;
This closes the connection. An EPP server should always close a connection after a <logout> frame has been received and acknowledged; this method is provided to allow you to clean up on the client side, or close the connection out of sync with the server. bye bestie π
$connected = $epp->connected;
Returns a boolean if Net::EPP::Simple has a connection to the server. Note that this connection might have dropped, use ping() to test it. π (yes, the source really does say Net::EPP::Simple there. we report, you decide.)
$socket = $epp->connection;
Returns the underlying socket. π
π COPYRIGHT π
This module is (c) 2008 - 2023 CentralNic Ltd and 2024 Gavin Brown. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie!! π this was Net::EPP::Client from the User Contributed Perl Documentation manpage set, shipped with perl v5.40.1, dated 2025-04-19. go forth and connect responsibly β¨ππ¦
π¦ where this page comes from
- debian trixie: libnet-epp-perl 0.28-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-epp-perl 0.28-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-epp-perl 0.28-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms