PKI Tutorials - Herong's Tutorial Examples - v2.32, by Herong Yang
HTTPS Request and Response Example
This section describes an example of HTTPS request and response captured by a Perl script using the Crypt::SSLeay module.
After running Crypt_SSLeay_HTTPS_GET.pl against https://login.yahoo.com, I opened the output file, test_yahoo.txt, to review request and response messages:
Request: GET https://login.yahoo.com User-Agent: libwww-perl/5.836 Response: HTTP/1.1 200 OK Cache-Control: private Connection: close Pragma: no-cache Content-Type: text/html Expires: 0 Client-Peer: 69.147.112.160:443 Client-Response-Num: 1 Client-SSL-Cert-Issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com /CN=DigiCert High Assurance CA-3 Client-SSL-Cert-Subject: /C=US/ST=CA/L=Sunnyvale/O=Yahoo! Inc. /CN=login.yahoo.com Client-SSL-Cipher: AES256-SHA Client-SSL-Warning: Peer certificate not verified Client-Transfer-Encoding: chunked Link: <https://s.yimg.com/lq/i/reg/css/yregbase_sec_ui_1_9.css>; ... P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP ... Title: Sign in to Yahoo! X-Frame-Options: DENY <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org... <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Sign in to Yahoo!</title> ...
The request message is very simple.
But the response message contains some interesting information:
The next question is how to ask Crypt::SSLeay to validate the server's certificate.
Table of Contents
Introduction of PKI (Public Key Infrastructure)
Introduction of HTTPS (Hypertext Transfer Protocol Secure)
Using HTTPS with Google Chrome
Using HTTPS with Mozilla Firefox
HTTPS with IE (Internet Explorer)
Android and Server Certificate
Windows Certificate Stores and Console
RDP (Remote Desktop Protocol) and Server Certificate
macOS Certificate Stores and Keychain Access
►Perl Scripts Communicating with HTTPS Servers
Installing Crypt::SSLeay 0.72 on Windows
LWP SSL verify_hostname Setting
LWP SSL List of Root CA Certificates
Crypt::SSLeay Test Perl Script
►HTTPS Request and Response Example
Asking Crypt::SSLeay to Verify Server's Certificate
Crypt::SSLeay Failing to Verify Server's Certificate
Multiple CA Certificates in a Single File
PHP Scripts Communicating with HTTPS Servers
Java Programs Communicating with HTTPS Servers
.NET Programs Communicating with HTTPS Servers
CAcert.org - Root CA Offering Free Certificates
PKI CA Administration - Issuing Certificates
Comodo Free Personal Certificate
Digital Signature - Microsoft Word
Digital Signature - OpenOffice.org 3