Hello

When I try and download a p12, it is corrupt.
I traced it down to get_privkey.html.

If I save the content directly on a file on the sever, it is valid, but it 
looks the corruption occurs when mod_perl sends the content (something related 
to bin mode I guess ?)

This give a broken download:

      $r->content_type ($content_type);
      print $item;
      return 1;


This ugly workaround works:

        my $tmpfile = File::Temp->new( TEMPLATE => 'tempXXXXX',
                        DIR => '/var/tmp/',
                        SUFFIX => '.bin');
        open (TMP ,">$tmpfile");
        print TMP $item;
        close TMP;
        $r->sendfile($tmpfile);
        unlink($tmpfile);
      return 1;


Alas, BINMODE STDOUT does not cure the problem :(
Any idea of a clean fix to send the $item in true raw mode to the output stream?


NB: In binary/*, shouldn't all occurrences of "application/octet-string" be 
replaced by "application/octet-stream" ?



Kind regards

Gaetan



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenXPKI-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openxpki-users

Reply via email to