http://www.perlmonks.org?node_id=1020525


in reply to Extract digital signature from HTTPS response

SSL connections provide several ways to restrict the acceptable certificate values that are presented, although these features are not commonly used in the Wooly Wild Internet.   Connection verification should be done at a protocol level.   Man-in-the-middle attacks should be prevented thereby.   If you trust the server you’re talking to, or the client you’re listening to, then HTTPS will transfer the bytes correctly.

Another way to do it on a more general scale is to use VPN with individually-issued digital certificates.

“Trust,” however, can be a big question, because, in the case of a data file, you must trust the file not the transport.   “Even if the message is being delivered by carrier pigeon, you must be able to trust the message, not the bird.”   If you return to the message weeks or months after delivery, you must still be able to authenticate its content.   The only way to do that is with a cryptographically signed file.   Tools like gpg can do that, whether or not the message itself is encrypted.   Your entire company workflow, not just this Perl program, must support that in order for it to be meaningful.

  • Comment on Re: Extract digital signature from HTTPS response

Replies are listed 'Best First'.
Re^2: Extract digital signature from HTTPS response
by stringZ (Acolyte) on Mar 12, 2013 at 08:00 UTC
    Here is what I want:

    I go to https://www.secure.com, navigate to a specific page on the site, then save its content to a file. As long as the page is in the browser, the HTTPS protocol itself grants the authenticity of the page, but after saving it to a file, anyone can modify it. Let's say I don't trust myself and nobody trusts me, but I must prove that this page, that has been saved to disk, has original content generated by www.secure.com. I can't sign it with my own-generated private key because as I mentioned, nobody trusts me. They only trust www.secure.com. So I would like to save either a raw HTTPS content or a decrypted HTTP response with a digital signature that can be verified if someone takes a look at the (cert / public key / whatever) of www.secure.com.