Net::EPP::Client(3pm)

πŸ“¦
version 0.28 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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 to 700.
  • ssl β€” OPTIONAL. If the value of this parameter is false, then a plaintext connection will be created. Otherwise, IO::Socket::SSL will be used to provide an encrypted connection. πŸ”
  • frames β€” DEPRECATED. If the value of this parameter is false, then the request() and get_frame() methods (see below) will return strings instead of Net::EPP::Frame::Response objects. 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 will croak() if connection fails, so be sure to use eval() 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::Document object (or an instance of a subclass)
  • an XML::DOM::Document object (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. πŸ”Œ


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