X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Ftsget;h=da900d98a1d24fb842ab3c2f5f9ff9e269d6041f;hb=0d4fb8439092ff8253af72ac6bc193e77ebbcf2f;hp=ddae803fbf3a782f7c253f000bda159f9013218d;hpb=c7235be6e36c4bef84594aa3b2f0561db84b63d8;p=oweals%2Fopenssl.git diff --git a/apps/tsget b/apps/tsget index ddae803fbf..da900d98a1 100644 --- a/apps/tsget +++ b/apps/tsget @@ -1,13 +1,13 @@ #!/usr/bin/perl -w # Written by Zoltan Glozik . # Copyright (c) 2002 The OpenTSA Project. All rights reserved. -$::version = '$Id: tsget,v 1.1 2006/02/12 23:11:21 ulf Exp $'; +$::version = '$Id: tsget,v 1.3 2009/09/07 17:57:18 steve Exp $'; use strict; use IO::Handle; use Getopt::Std; use File::Basename; -use WWW::Curl::easy; +use WWW::Curl::Easy; use vars qw(%options); @@ -37,7 +37,7 @@ sub create_curl { my $url = shift; # Create Curl object. - my $curl = WWW::Curl::easy::new(); + my $curl = WWW::Curl::Easy::new(); # Error-handling related options. $curl->setopt(CURLOPT_VERBOSE, 1) if $options{d}; @@ -49,7 +49,7 @@ sub create_curl { $curl->setopt(CURLOPT_CUSTOMREQUEST, "POST"); $curl->setopt(CURLOPT_HTTPHEADER, ["Content-Type: application/timestamp-query", - "Accept: application/timestamp-reply"]); + "Accept: application/timestamp-reply,application/timestamp-response"]); $curl->setopt(CURLOPT_READFUNCTION, \&read_body); $curl->setopt(CURLOPT_HEADERFUNCTION, sub { return length($_[0]); }); @@ -102,7 +102,8 @@ sub get_timestamp { $error_string .= " ($::error_buf)" if defined($::error_buf); } else { my $ct = $curl->getinfo(CURLINFO_CONTENT_TYPE); - if (lc($ct) ne "application/timestamp-reply") { + if (lc($ct) ne "application/timestamp-reply" + && lc($ct) ne "application/timestamp-response") { $error_string = "unexpected content type returned: $ct"; } } @@ -192,4 +193,4 @@ REQUEST: foreach (@ARGV) { STDERR->printflush(", $output written.\n") if $options{v}; } $curl->cleanup(); -WWW::Curl::easy::global_cleanup(); +WWW::Curl::Easy::global_cleanup();