aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2021-02-16 01:06:01 +0100
committerGuilhem Moulin <guilhem@fripost.org>2021-02-18 00:42:32 +0100
commitc75bc6c37840b8fc2c57424d24c06a0bfe399de6 (patch)
tree5578c259a4e3b16f3a8cfa797b948223b75dc3b6 /client
parent35ba3f6919fbd4a724383169d16f9eec43a27989 (diff)
client: use "lacme-client/$VERSION" as User-Agent header.
Diffstat (limited to 'client')
-rwxr-xr-xclient4
1 files changed, 3 insertions, 1 deletions
diff --git a/client b/client
index e457df1..bcdf6cd 100755
--- a/client
+++ b/client
@@ -43,7 +43,9 @@ use warnings;
# instance own by another user and created with umask 0177) is not a
# problem since SOCKET_FD can be bound as root prior to the execve(2).
+our $VERSION = '0.3';
my $PROTOCOL_VERSION = 1;
+my $NAME = 'lacme-client';
use Errno 'EEXIST';
use Fcntl qw/O_CREAT O_EXCL O_WRONLY/;
@@ -103,7 +105,7 @@ my $UA = do {
my $verify = lc (delete $args{SSL_verify} // 'Yes') eq 'no' ? 0 : 1;
my %ssl_opts = ( verify_hostname => $verify );
$ssl_opts{$_} = $args{$_} foreach grep /^SSL_/, keys %args;
- LWP::UserAgent::->new( ssl_opts => \%ssl_opts );
+ LWP::UserAgent::->new( agent => "$NAME/$VERSION", ssl_opts => \%ssl_opts );
} // die "Can't create LWP::UserAgent object";
$UA->default_header( 'Accept-Language' => 'en' );