Commit 3f629143 authored by Gavin Brown's avatar Gavin Brown
Browse files

fix handle_domain_clone function name.

add support for client certs
add --insecure argument
parent dc81f86f
...@@ -19,6 +19,7 @@ GetOptions($opt, ...@@ -19,6 +19,7 @@ GetOptions($opt,
'timeout=i', 'timeout=i',
'help', 'help',
'exec=s', 'exec=s',
'insecure',
); );
my $handlers = { my $handlers = {
...@@ -47,6 +48,8 @@ my $handlers = { ...@@ -47,6 +48,8 @@ my $handlers = {
'renew' => \&handle_renew, 'renew' => \&handle_renew,
'create' => \&handle_create, 'create' => \&handle_create,
'edit' => \&handle_edit, 'edit' => \&handle_edit,
'cert' => \&handle_cert,
'key' => \&handle_key,
}; };
if ($opt->{'help'}) { if ($opt->{'help'}) {
...@@ -60,6 +63,7 @@ my $epp = Net::EPP::Simple->new( ...@@ -60,6 +63,7 @@ my $epp = Net::EPP::Simple->new(
'debug' => ($opt->{'exec'} eq ''), 'debug' => ($opt->{'exec'} eq ''),
'login' => undef, 'login' => undef,
'reconnect' => 0, 'reconnect' => 0,
'verify' => ($opt->{'insecure'} ? undef : 1),
); );
my $term = Term::ReadLine->new('pepper'); my $term = Term::ReadLine->new('pepper');
...@@ -437,7 +441,7 @@ sub handle_clone { ...@@ -437,7 +441,7 @@ sub handle_clone {
return handle_contact_clone($old, $new); return handle_contact_clone($old, $new);
} elsif (lc($type) eq 'domain') { } elsif (lc($type) eq 'domain') {
return handle_contact_domain($old, $new); return handle_domain_clone($old, $new);
} else { } else {
error("Unsupported object type '$type'"); error("Unsupported object type '$type'");
...@@ -456,7 +460,7 @@ sub handle_contact_clone { ...@@ -456,7 +460,7 @@ sub handle_contact_clone {
return $epp->create_contact($info); return $epp->create_contact($info);
} }
sub handle_contact_domain { sub handle_domain_clone {
my ($old, $new) = @_; my ($old, $new) = @_;
my $info = $epp->domain_info($old) || return; my $info = $epp->domain_info($old) || return;
...@@ -555,6 +559,19 @@ sub handle_edit { ...@@ -555,6 +559,19 @@ sub handle_edit {
} }
} }
sub handle_key {
my ($key, $pass) = @_;
$epp->{'key'} = $key;
$epp->{'passphrase'} = $pass;
note("Using '$key' as private key");
}
sub handle_cert {
my $cert = shift;
$epp->{'cert'} = $cert;
note("Using '$cert' as certificate");
}
sub note { sub note {
my ($fmt, @args) = @_; my ($fmt, @args) = @_;
my $msg = sprintf($fmt, @args); my $msg = sprintf($fmt, @args);
...@@ -612,6 +629,10 @@ Specify password. ...@@ -612,6 +629,10 @@ Specify password.
Specify command to execute. May be used multiple times. See L<SYNTAX> for more details. Specify command to execute. May be used multiple times. See L<SYNTAX> for more details.
=item C<--insecure>
Disable SSL certificate checks.
=back =back
=head1 SYNTAX =head1 SYNTAX
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment