IO-EPP

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

use warnings;
use strict;

WriteMakefile(
    NAME               => 'IO::EPP',
    AUTHOR             => 'Vadim Likhota <vadiml@cpan.org>',
    LICENSE            => 'perl',
    VERSION_FROM       => 'lib/IO/EPP.pm',
    PREREQ_PM          => {
	'IO::Socket'         => 0,
	'IO::Socket::SSL'    => 0,
	'LWP::UserAgent'     => 0,
	'HTTP::Request'      => 0,
	'HTTP::Cookies'      => 0,
	'Digest::MD5'        => 0,
	'Time::HiRes'        => 0,
	'parent'             => 0,
	'strict'             => 0,
	'warnings'           => 0,
    },
    BUILD_REQUIRES     => {

lib/IO/EPP.pm  view on Meta::CPAN

=head1 SYNOPSIS

    use IO::EPP;
    print "IO::EPP version is $IO::EPP::VERSION\n";

=head1 DESCRIPTION

IO::EPP is a very light and fast interface of the access to EPP API from the client's side with minimum dependences.
It is independent of libxml and other heavy libraries.

It works over L<IO::Socket::SSL> without additional modules and demands only L<Digest::MD5> for generation of unique ID and L<Time::HiRes> for the purpose of logging.
L<LWP> is necessary for two registries and one reseller (TCI/RIPN, Taeping и HosterKZ), because EPP of these providers works over HTTPS.

In test mode IO::EPP can emulate the job of some registries.
Now the emulation of Verisign Core and CentralNic servers is supported at the level of 99% of answers.
The test environment for L<IO::EPP::Base> uses the emulation of CentralNic without extensions.

The main difference of the emulation from a registry is that all the data are into the process which makes requests. That's why when the process comes to the end all the data will be lost.
If you want to save the data between queries you need to replace the functions in the module L<IO::EPP::Test::Server>.

The library IO::EPP has two ways of working - procedural or object one.

lib/IO/EPP.pm  view on Meta::CPAN


=head1 OBJECT STYLE WORK

It is more convenient for cases when it is necessary to keep the connection with the registry.

An example of registration of a new nameserver

    use IO::EPP::CNic;
    use Data::Dumper;

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost        => 'epp.centralnic.com',
        PeerPort        => 700,
        SSL_key_file    => 'ssl_key_file.pem',
        SSL_cert_file   => 'ssl_cert_file.pem',
        Timeout         => 30,
        debug           => 1,
    );

    # Login parameters

lib/IO/EPP.pm  view on Meta::CPAN


        unless ( $params->{tld} ) {
            my $msg = 'Not found tld';
            return ( { code => 0, msg => "code: 0\nmsg: $msg" }, $msg, 0 );
        }

        unless ( $params->{conn} ) {
            # need create new connection
            state $config = Config::get('Providers.Verisign');

            # Parameters for IO::Socket::SSL
            my %sock_params = (
                PeerPort         => $config->{port},
                Proto            => 'tcp',
                SSL_key_file     => $config->{ssl_key_file},
                SSL_cert_file    => $config->{ssl_cert_file},
                # SSL_verify_mode => SSL_VERIFY_NONE, -- for this parameter need use IO::Socket::SSL
                Timeout          => 30,
                debug            => 1,
            );

            if ( $params->{tld} =~ /^(com|net|edu)$/ ) {
                $params->{server}      = 'Core';
                $params->{user}        = $config->{core_username};
                $params->{pass}        = $config->{core_password};
                $sock_params{PeerHost} = $config->{core_url}; # epp.verisign-grs.com
            }

lib/IO/EPP/Afilias.pm  view on Meta::CPAN

=encoding utf8

=head1 NAME

IO::EPP::Afilias

=head1 SYNOPSIS

    use IO::EPP::Afilias;

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost        => 'epp.afilias.net',
        PeerPort        => 700,
        SSL_key_file    => 'key_file.pem',
        SSL_cert_file   => 'cert_file.pem',
        Timeout         => 30,
    );

    # Create object, get greeting and call login()
    my $conn = IO::EPP::Afilias->new( {

lib/IO/EPP/Base.pm  view on Meta::CPAN

The module can be used to work with any provider,
if the requests do not use extensions and the provider does not have its own features

It has two options: using a separate function call or working as an object

=cut

use Digest::MD5 qw(md5_hex);
use Time::HiRes qw(time);
use IO::Socket;
use IO::Socket::SSL;

use strict;
use warnings;

# common chunks for all standard queries
our $epp_head = '<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">';
our $epp_cont_urn =
'xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:contact-1.0 contact-1.0.xsd"';
our $epp_host_urn =

lib/IO/EPP/Base.pm  view on Meta::CPAN



=head1 METHODS

=head2 new

Create new IO::EPP object, аutomatically connects to the provider and logins.

Example of a call

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost => 'epp.example.com',
        PeerPort => 700,
        SSL_key_file  => $path_to_ssl_key_file,
        SSL_cert_file => $path_to_ssl_cert_file,
        Timeout  => 30,
    );

    # initialization of an object, during which login is called
    my $o = IO::EPP::Base->new( {

lib/IO/EPP/Base.pm  view on Meta::CPAN

Connection parameters:

C<user>        – login;

C<pass>        – password;

C<tld>         – zone for providers that have a binding in it, for example, verisign;

C<server>      – server name if the registry has different servers with different extensions, for example, pir/afilias for afilias;

C<sock_params> – hashref with L<IO::Socket::SSL> parameters;

C<test_mode>   – use a real connection or registry emulator.

Parameters for logging:

C<no_log>   – do not write anything to the log;

C<log_name> – write log in this file, not in STDOUT;

C<log_fn>   – ref on functions to write to the log.

lib/IO/EPP/Base.pm  view on Meta::CPAN

    my $sock;

    my $sock_params = delete $params->{sock_params};

    my $test = delete $params->{test_mode};

    if ( $test ) {
        $sock = $sock_params->{PeerHost} . ':' . $sock_params->{PeerPort};
    }
    else {
        $sock = IO::Socket::SSL->new(
            PeerPort => 700,
            Timeout  => 30,
            %{$sock_params},
        );
    }

    unless ( $sock ) {
        $msg = "can not connect";
        $code = 0;

lib/IO/EPP/CNic.pm  view on Meta::CPAN

=encoding utf8

=head1 NAME

IO::EPP::CNic

=head1 SYNOPSIS

    use IO::EPP::CNic;

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost        => 'epp.centralnic.com',
        PeerPort        => 700,
        SSL_key_file    => 'key_file.pem',
        SSL_cert_file   => 'cert_file.pem',
        Timeout         => 30,
    );

    # Create object, get greeting and call login()
    my $conn = IO::EPP::CNic->new( {

lib/IO/EPP/CoCCA.pm  view on Meta::CPAN

=encoding utf8

=head1 NAME

IO::EPP::CoCCA

=head1 SYNOPSIS

    use IO::EPP::CoCCA;

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost        => 'registry.rusnames.net',
        PeerPort        => 700,
        # without certificate
        Timeout         => 30,
    );

    # Create object, get greeting and call login()
    my $conn = IO::EPP::CoCCA->new( {
        user => 'login',

lib/IO/EPP/CoreNic.pm  view on Meta::CPAN

=encoding utf8

=head1 NAME

IO::EPP::CoreNic

=head1 SYNOPSIS

    use IO::EPP::CoreNic;

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost        => 'epp.nic.xn--80aswg',
        PeerPort        => 700,
        # without certificate
        Timeout         => 30,
    );

    # Create object, get greeting and call login()
    my $conn = IO::EPP::CoreNic->new( {
        user => 'login',

lib/IO/EPP/DrsUa.pm  view on Meta::CPAN

=encoding utf8

=head1 NAME

IO::EPP::DrsUa

=head1 SYNOPSIS

    use IO::EPP::DrsUa;

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost        => 'epp.uadns.com',
        PeerPort        => 700,
        # without certificate
        Timeout         => 30,
    );

    # Create object, get greeting and call login()
    my $conn = IO::EPP::DrsUa->new( {
        user => 'login',

lib/IO/EPP/Flexireg.pm  view on Meta::CPAN

=encoding utf8

=head1 NAME

IO::EPP::Flexireg

=head1 SYNOPSIS

    use IO::EPP::Flexireg;

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost        => 'epp.flexireg.net',
        PeerPort        => 700,
        Timeout         => 30,
    );

    # Create object, get greeting and call login()
    my $conn = IO::EPP::Flexireg->new( {
        user => 'login-msk-fir',
        pass => 'xxxxxxxx',

lib/IO/EPP/IRRP.pm  view on Meta::CPAN

=encoding utf8

=head1 NAME

IO::EPP::IRRP

=head1 SYNOPSIS

    use IO::EPP::IRRP;

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost        => 'epp.ispapi.net',
        PeerPort        => 700,
        Timeout         => 30,
    );

    # Create object, get greeting and call login()
    my $conn = IO::EPP::IRRP->new( {
        user => 'login',
        pass => 'xxxxx',

lib/IO/EPP/RRPProxy.pm  view on Meta::CPAN

=encoding utf8

=head1 NAME

IO::EPP::RRPProxy

=head1 SYNOPSIS

    use IO::EPP::RRPProxy;

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost        => 'epp.rrpproxy.net',
        PeerPort        => 700,
        Timeout         => 30,
    );

    # Create object, get greeting and call login()
    my $conn = IO::EPP::RRPProxy->new( {
        user => 'login',
        pass => 'xxxxx',

lib/IO/EPP/TCI.pm  view on Meta::CPAN

=encoding utf8

=head1 NAME

IO::EPP::TCI

=head1 SYNOPSIS

    use IO::EPP::TCI;

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost        => 'uap.tcinet.ru',
        PeerPort        => 8130, # .дети 8130, .tatar 8131
        SSL_key_file    => 'key_file.pem',
        SSL_cert_file   => 'cert_file.pem',
        Timeout         => 30,
    );

    # Create object, get greeting and call login()
    my $conn = IO::EPP::TCI->new( {

lib/IO/EPP/Taeping.pm  view on Meta::CPAN

L<https://nic.net.ru/docs/EPP-3LVL.pdf>

All documents -- L<http://pp.ru/documents.html>

IO::EPP::Taeping works with .net.ru, .org.ru  & .pp.ru only

Domain transfer in these zones works as in the .su tld

=cut

use IO::Socket::SSL;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Cookies;
use Time::HiRes qw( time );

use IO::EPP::Base;
use IO::EPP::RIPN;
use parent qw( IO::EPP::RIPN );

use strict;

lib/IO/EPP/Verisign.pm  view on Meta::CPAN

=encoding utf8

=head1 NAME

IO::EPP::Verisign

=head1 SYNOPSIS

    use IO::EPP::Verisign;

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost        => 'epp.verisign-grs.com',
        PeerPort        => 700,
        SSL_key_file    => 'key_file.pem',
        SSL_cert_file   => 'cert_file.pem',
        Timeout         => 30,
    );

    # Create object, get greeting and call login()
    my $conn = IO::EPP::Verisign->new( {



( run in 0.774 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )