1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5e71b7053SJung-uk Kimtsget - Time Stamping HTTP/HTTPS client 6e71b7053SJung-uk Kim 7e71b7053SJung-uk Kim=head1 SYNOPSIS 8e71b7053SJung-uk Kim 9e71b7053SJung-uk KimB<tsget> 10*b077aed3SPierre ProncheryB<-h> I<server_url> 11*b077aed3SPierre Pronchery[B<-e> I<extension>] 12*b077aed3SPierre Pronchery[B<-o> I<output>] 13e71b7053SJung-uk Kim[B<-v>] 14e71b7053SJung-uk Kim[B<-d>] 15*b077aed3SPierre Pronchery[B<-k> I<private_key.pem>] 16*b077aed3SPierre Pronchery[B<-p> I<key_password>] 17*b077aed3SPierre Pronchery[B<-c> I<client_cert.pem>] 18*b077aed3SPierre Pronchery[B<-C> I<CA_certs.pem>] 19*b077aed3SPierre Pronchery[B<-P> I<CA_path>] 20*b077aed3SPierre Pronchery[B<-r> I<files>] 21*b077aed3SPierre Pronchery[B<-g> I<EGD_socket>] 22*b077aed3SPierre Pronchery[I<request> ...] 23e71b7053SJung-uk Kim 24e71b7053SJung-uk Kim=head1 DESCRIPTION 25e71b7053SJung-uk Kim 26*b077aed3SPierre ProncheryThis command can be used for sending a timestamp request, as specified 27*b077aed3SPierre Proncheryin RFC 3161, to a timestamp server over HTTP or HTTPS and storing the 28*b077aed3SPierre Proncherytimestamp response in a file. It cannot be used for creating the requests 29*b077aed3SPierre Proncheryand verifying responses, you have to use L<openssl-ts(1)> to do that. This 30*b077aed3SPierre Proncherycommand can send several requests to the server without closing the TCP 31*b077aed3SPierre Proncheryconnection if more than one requests are specified on the command line. 32e71b7053SJung-uk Kim 33*b077aed3SPierre ProncheryThis command sends the following HTTP request for each timestamp request: 34e71b7053SJung-uk Kim 35e71b7053SJung-uk Kim POST url HTTP/1.1 36e71b7053SJung-uk Kim User-Agent: OpenTSA tsget.pl/<version> 37e71b7053SJung-uk Kim Host: <host>:<port> 38e71b7053SJung-uk Kim Pragma: no-cache 39e71b7053SJung-uk Kim Content-Type: application/timestamp-query 40e71b7053SJung-uk Kim Accept: application/timestamp-reply 41e71b7053SJung-uk Kim Content-Length: length of body 42e71b7053SJung-uk Kim 43e71b7053SJung-uk Kim ...binary request specified by the user... 44e71b7053SJung-uk Kim 45*b077aed3SPierre ProncheryIt expects a response of type application/timestamp-reply, which is 46e71b7053SJung-uk Kimwritten to a file without any interpretation. 47e71b7053SJung-uk Kim 48e71b7053SJung-uk Kim=head1 OPTIONS 49e71b7053SJung-uk Kim 50e71b7053SJung-uk Kim=over 4 51e71b7053SJung-uk Kim 52*b077aed3SPierre Pronchery=item B<-h> I<server_url> 53e71b7053SJung-uk Kim 54e71b7053SJung-uk KimThe URL of the HTTP/HTTPS server listening for timestamp requests. 55e71b7053SJung-uk Kim 56*b077aed3SPierre Pronchery=item B<-e> I<extension> 57e71b7053SJung-uk Kim 58e71b7053SJung-uk KimIf the B<-o> option is not given this argument specifies the extension of the 59e71b7053SJung-uk Kimoutput files. The base name of the output file will be the same as those of 60*b077aed3SPierre Proncherythe input files. Default extension is F<.tsr>. (Optional) 61e71b7053SJung-uk Kim 62*b077aed3SPierre Pronchery=item B<-o> I<output> 63e71b7053SJung-uk Kim 64e71b7053SJung-uk KimThis option can be specified only when just one request is sent to the 65e71b7053SJung-uk Kimserver. The timestamp response will be written to the given output file. '-' 66e71b7053SJung-uk Kimmeans standard output. In case of multiple timestamp requests or the absence 67e71b7053SJung-uk Kimof this argument the names of the output files will be derived from the names 68e71b7053SJung-uk Kimof the input files and the default or specified extension argument. (Optional) 69e71b7053SJung-uk Kim 70e71b7053SJung-uk Kim=item B<-v> 71e71b7053SJung-uk Kim 72e71b7053SJung-uk KimThe name of the currently processed request is printed on standard 73e71b7053SJung-uk Kimerror. (Optional) 74e71b7053SJung-uk Kim 75e71b7053SJung-uk Kim=item B<-d> 76e71b7053SJung-uk Kim 77*b077aed3SPierre Pronchery=for comment perlpodstyle(1) says to refer to modules without section 78e71b7053SJung-uk Kim 79*b077aed3SPierre ProncherySwitches on verbose mode for the underlying perl module L<WWW::Curl::Easy>. 80*b077aed3SPierre ProncheryYou can see detailed debug messages for the connection. (Optional) 81*b077aed3SPierre Pronchery 82*b077aed3SPierre Pronchery=item B<-k> I<private_key.pem> 83e71b7053SJung-uk Kim 84e71b7053SJung-uk Kim(HTTPS) In case of certificate-based client authentication over HTTPS 85*b077aed3SPierre ProncheryI<private_key.pem> must contain the private key of the user. The private key 86e71b7053SJung-uk Kimfile can optionally be protected by a passphrase. The B<-c> option must also 87e71b7053SJung-uk Kimbe specified. (Optional) 88e71b7053SJung-uk Kim 89*b077aed3SPierre Pronchery=item B<-p> I<key_password> 90e71b7053SJung-uk Kim 91e71b7053SJung-uk Kim(HTTPS) Specifies the passphrase for the private key specified by the B<-k> 92*b077aed3SPierre Proncheryargument. If this option is omitted and the key is passphrase protected, 93*b077aed3SPierre Proncheryit will be prompted for. (Optional) 94e71b7053SJung-uk Kim 95*b077aed3SPierre Pronchery=item B<-c> I<client_cert.pem> 96e71b7053SJung-uk Kim 97e71b7053SJung-uk Kim(HTTPS) In case of certificate-based client authentication over HTTPS 98*b077aed3SPierre ProncheryI<client_cert.pem> must contain the X.509 certificate of the user. The B<-k> 99e71b7053SJung-uk Kimoption must also be specified. If this option is not specified no 100e71b7053SJung-uk Kimcertificate-based client authentication will take place. (Optional) 101e71b7053SJung-uk Kim 102*b077aed3SPierre Pronchery=item B<-C> I<CA_certs.pem> 103e71b7053SJung-uk Kim 104e71b7053SJung-uk Kim(HTTPS) The trusted CA certificate store. The certificate chain of the peer's 105e71b7053SJung-uk Kimcertificate must include one of the CA certificates specified in this file. 106e71b7053SJung-uk KimEither option B<-C> or option B<-P> must be given in case of HTTPS. (Optional) 107e71b7053SJung-uk Kim 108*b077aed3SPierre Pronchery=item B<-P> I<CA_path> 109e71b7053SJung-uk Kim 110e71b7053SJung-uk Kim(HTTPS) The path containing the trusted CA certificates to verify the peer's 111*b077aed3SPierre Proncherycertificate. The directory must be prepared with L<openssl-rehash(1)>. Either 112*b077aed3SPierre Proncheryoption B<-C> or option B<-P> must be given in case of HTTPS. (Optional) 113e71b7053SJung-uk Kim 114*b077aed3SPierre Pronchery=item B<-r> I<files> 115e71b7053SJung-uk Kim 116*b077aed3SPierre ProncherySee L<openssl(1)/Random State Options> for more information. 117e71b7053SJung-uk Kim 118*b077aed3SPierre Pronchery=item B<-g> I<EGD_socket> 119e71b7053SJung-uk Kim 120e71b7053SJung-uk KimThe name of an EGD socket to get random data from. (Optional) 121e71b7053SJung-uk Kim 122*b077aed3SPierre Pronchery=item I<request> ... 123e71b7053SJung-uk Kim 124*b077aed3SPierre ProncheryList of files containing RFC 3161 DER-encoded timestamp requests. If no 125*b077aed3SPierre Proncheryrequests are specified only one request will be sent to the server and it will 126*b077aed3SPierre Proncherybe read from the standard input. 127*b077aed3SPierre Pronchery(Optional) 128e71b7053SJung-uk Kim 129e71b7053SJung-uk Kim=back 130e71b7053SJung-uk Kim 131e71b7053SJung-uk Kim=head1 ENVIRONMENT VARIABLES 132e71b7053SJung-uk Kim 133e71b7053SJung-uk KimThe B<TSGET> environment variable can optionally contain default 134e71b7053SJung-uk Kimarguments. The content of this variable is added to the list of command line 135e71b7053SJung-uk Kimarguments. 136e71b7053SJung-uk Kim 137e71b7053SJung-uk Kim=head1 EXAMPLES 138e71b7053SJung-uk Kim 139*b077aed3SPierre ProncheryThe examples below presume that F<file1.tsq> and F<file2.tsq> contain valid 140e71b7053SJung-uk Kimtimestamp requests, tsa.opentsa.org listens at port 8080 for HTTP requests 141e71b7053SJung-uk Kimand at port 8443 for HTTPS requests, the TSA service is available at the /tsa 142e71b7053SJung-uk Kimabsolute path. 143e71b7053SJung-uk Kim 144*b077aed3SPierre ProncheryGet a timestamp response for F<file1.tsq> over HTTP, output is written to 145*b077aed3SPierre ProncheryF<file1.tsr>: 146e71b7053SJung-uk Kim 147e71b7053SJung-uk Kim tsget -h http://tsa.opentsa.org:8080/tsa file1.tsq 148e71b7053SJung-uk Kim 149*b077aed3SPierre ProncheryGet a timestamp response for F<file1.tsq> and F<file2.tsq> over HTTP showing 150*b077aed3SPierre Proncheryprogress, output is written to F<file1.reply> and F<file2.reply> respectively: 151e71b7053SJung-uk Kim 152e71b7053SJung-uk Kim tsget -h http://tsa.opentsa.org:8080/tsa -v -e .reply \ 153e71b7053SJung-uk Kim file1.tsq file2.tsq 154e71b7053SJung-uk Kim 155*b077aed3SPierre ProncheryCreate a timestamp request, write it to F<file3.tsq>, send it to the server and 156*b077aed3SPierre Proncherywrite the response to F<file3.tsr>: 157e71b7053SJung-uk Kim 158e71b7053SJung-uk Kim openssl ts -query -data file3.txt -cert | tee file3.tsq \ 159e71b7053SJung-uk Kim | tsget -h http://tsa.opentsa.org:8080/tsa \ 160e71b7053SJung-uk Kim -o file3.tsr 161e71b7053SJung-uk Kim 162*b077aed3SPierre ProncheryGet a timestamp response for F<file1.tsq> over HTTPS without client 163e71b7053SJung-uk Kimauthentication: 164e71b7053SJung-uk Kim 165e71b7053SJung-uk Kim tsget -h https://tsa.opentsa.org:8443/tsa \ 166e71b7053SJung-uk Kim -C cacerts.pem file1.tsq 167e71b7053SJung-uk Kim 168*b077aed3SPierre ProncheryGet a timestamp response for F<file1.tsq> over HTTPS with certificate-based 169*b077aed3SPierre Proncheryclient authentication (it will ask for the passphrase if F<client_key.pem> is 170e71b7053SJung-uk Kimprotected): 171e71b7053SJung-uk Kim 172e71b7053SJung-uk Kim tsget -h https://tsa.opentsa.org:8443/tsa -C cacerts.pem \ 173e71b7053SJung-uk Kim -k client_key.pem -c client_cert.pem file1.tsq 174e71b7053SJung-uk Kim 175e71b7053SJung-uk KimYou can shorten the previous command line if you make use of the B<TSGET> 176e71b7053SJung-uk Kimenvironment variable. The following commands do the same as the previous 177e71b7053SJung-uk Kimexample: 178e71b7053SJung-uk Kim 179e71b7053SJung-uk Kim TSGET='-h https://tsa.opentsa.org:8443/tsa -C cacerts.pem \ 180e71b7053SJung-uk Kim -k client_key.pem -c client_cert.pem' 181e71b7053SJung-uk Kim export TSGET 182e71b7053SJung-uk Kim tsget file1.tsq 183e71b7053SJung-uk Kim 184e71b7053SJung-uk Kim=head1 SEE ALSO 185e71b7053SJung-uk Kim 186*b077aed3SPierre Pronchery=for openssl foreign manual WWW::Curl::Easy 187e71b7053SJung-uk Kim 188*b077aed3SPierre ProncheryL<openssl(1)>, 189*b077aed3SPierre ProncheryL<openssl-ts(1)>, 190*b077aed3SPierre ProncheryL<WWW::Curl::Easy>, 191*b077aed3SPierre ProncheryL<https://www.rfc-editor.org/rfc/rfc3161.html> 192e71b7053SJung-uk Kim 193e71b7053SJung-uk Kim=head1 COPYRIGHT 194e71b7053SJung-uk Kim 19558f35182SJung-uk KimCopyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved. 196e71b7053SJung-uk Kim 197*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 198e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 199e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 200e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 201e71b7053SJung-uk Kim 202e71b7053SJung-uk Kim=cut 203