TSGET(1) OpenSSL TSGET(1) NNAAMMEE openssl-tsget, tsget - Time Stamping HTTP/HTTPS client SSYYNNOOPPSSIISS ttssggeett --hh server_url [--ee extension] [--oo output] [--vv] [--dd] [--kk pri- vate_key.pem] [--pp key_password] [--cc client_cert.pem] [--CC CA_certs.pem] [--PP CA_path] [--rr file:file...] [--gg EGD_socket] [request]... DDEESSCCRRIIPPTTIIOONN The ttssggeett command can be used for sending a time stamp request, as specified in RRFFCC 33116611, to a time stamp server over HTTP or HTTPS and storing the time stamp response in a file. This tool cannot be used for creating the requests and verifying responses, you can use the OpenSSL _tt_ss((11)) command to do that. ttssggeett can send several requests to the server without closing the TCP connection if more than one requests are speci- fied on the command line. The tool sends the following HTTP request for each time stamp request: POST url HTTP/1.1 User-Agent: OpenTSA tsget.pl/ Host: : Pragma: no-cache Content-Type: application/timestamp-query Accept: application/timestamp-reply Content-Length: length of body ...binary request specified by the user... ttssggeett expects a response of type application/timestamp-reply, which is written to a file without any interpretation. OOPPTTIIOONNSS --hh server_url The URL of the HTTP/HTTPS server listening for time stamp requests. --ee extension If the --oo option is not given this argument specifies the extension of the output files. The base name of the output file will be the same as those of the input files. Default extension is '.tsr'. (Optional) --oo output This option can be specified only when just one request is sent to the server. The time stamp response will be written to the given output file. '-' means standard output. In case of multiple time stamp requests or the absence of this argument the names of the output files will be derived from the names of the input files and the default or specified extension argument. (Optional) --vv The name of the currently processed request is printed on standard error. (Optional) --dd Switches on verbose mode for the underlying ccuurrll library. You can see detailed debug messages for the connection. (Optional) --kk private_key.pem (HTTPS) In case of certificate-based client authentication over HTTPS must contain the private key of the user. The private key file can optionally be protected by a passphrase. The --cc option must also be specified. (Optional) --pp key_password (HTTPS) Specifies the passphrase for the private key specified by the --kk argument. If this option is omitted and the key is passphrase protected ttssggeett will ask for it. (Optional) --cc client_cert.pem (HTTPS) In case of certificate-based client authentication over HTTPS must contain the X.509 certificate of the user. The --kk option must also be specified. If this option is not specified no certificate-based client authentication will take place. (Optional) --CC CA_certs.pem (HTTPS) The trusted CA certificate store. The certificate chain of the peer's certificate must include one of the CA certificates specified in this file. Either option --CC or option --PP must be given in case of HTTPS. (Optional) --PP CA_path (HTTPS) The path containing the trusted CA certificates to verify the peer's certificate. The directory must be prepared with the cc__rreehhaasshh OpenSSL utility. Either option --CC or option --PP must be given in case of HTTPS. (Optional) --rraanndd file:file... The files containing random data for seeding the random number gen- erator. Multiple files can be specified, the separator is ;; for MS-Windows, ,, for VMS and :: for all other platforms. (Optional) --gg EGD_socket The name of an EGD socket to get random data from. (Optional) [request]... List of files containing RRFFCC 33116611 DER-encoded time stamp requests. If no requests are specified only one request will be sent to the server and it will be read from the standard input. (Optional) EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS The TTSSGGEETT environment variable can optionally contain default argu- ments. The content of this variable is added to the list of command line arguments. EEXXAAMMPPLLEESS The examples below presume that ffiillee11..ttssqq and ffiillee22..ttssqq contain valid time stamp requests, tsa.opentsa.org listens at port 8080 for HTTP requests and at port 8443 for HTTPS requests, the TSA service is avail- able at the /tsa absolute path. Get a time stamp response for file1.tsq over HTTP, output is written to file1.tsr: tsget -h http://tsa.opentsa.org:8080/tsa file1.tsq Get a time stamp response for file1.tsq and file2.tsq over HTTP showing progress, output is written to file1.reply and file2.reply respec- tively: tsget -h http://tsa.opentsa.org:8080/tsa -v -e .reply \ file1.tsq file2.tsq Create a time stamp request, write it to file3.tsq, send it to the server and write the response to file3.tsr: openssl ts -query -data file3.txt -cert | tee file3.tsq \ | tsget -h http://tsa.opentsa.org:8080/tsa \ -o file3.tsr Get a time stamp response for file1.tsq over HTTPS without client authentication: tsget -h https://tsa.opentsa.org:8443/tsa \ -C cacerts.pem file1.tsq Get a time stamp response for file1.tsq over HTTPS with certificate- based client authentication (it will ask for the passphrase if client_key.pem is protected): tsget -h https://tsa.opentsa.org:8443/tsa -C cacerts.pem \ -k client_key.pem -c client_cert.pem file1.tsq You can shorten the previous command line if you make use of the TTSSGGEETT environment variable. The following commands do the same as the previ- ous example: TSGET='-h https://tsa.opentsa.org:8443/tsa -C cacerts.pem \ -k client_key.pem -c client_cert.pem' export TSGET tsget file1.tsq AAUUTTHHOORR Zoltan Glozik , OpenTSA project (http://www.opentsa.org) SSEEEE AALLSSOO _o_p_e_n_s_s_l(1), _t_s(1), _c_u_r_l(1), RRFFCC 33116611 1.0.2u 2019-12-20 TSGET(1)