Documente Academic
Documente Profesional
Documente Cultură
READ FIRST:
This exercise is relatively programming-heavy, so you might need to refresh your skills if you havent
been coding for a while. Youre free to discuss any problems you encounter with other students but all
programming work must be done individually.
If OpenSSL accepts the chain, you must further check if the server's certificate's subject's common name
matches the host name given as the command line parameter. You don't have to support wild cards.
Matching failure must cause your program to terminate.
Finally, if everything went right, your program sends out the HTTP request and outputs the web page
sent by the server to stdout. It must then gracefully free all resources and terminate with the exit code
0.
Some example outputs of the model ssl program are listed in 1.2 1.4. Your program should behave
mostly identically. Please choose meaningful error messages, and get one from OpenSSL if possible.
Keep it short: your solution must be a single .c or .cpp file. Some useful links:
http://www.rtfm.com/openssl-examples/part1.pdf
http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html
1.1 DETAILS
OpenSSL needs to know where it loads CA certificates for verification purposes. You must use a search
path (do not use a bundle file). This search path should be set to /etc/ssl/certs in your submission.
With OpenSSL development libraries (libssl-dev in Ubuntu) present, your program must compile with
either:
gcc -std=c99 -Wall -pedantic ssl.c -o ssl -lcrypto -lssl
or
g++ -std=c++98 -Wall -pedantic ssl.cpp -o ssl -lcrypto lssl
You can use your own (virtual) Linux or kosh.aalto.fi for developing and testing your program.
Certificate issuer:
- Common name: GeoTrust Global CA
- Organization name: GeoTrust Inc.
===
Certificate OK: yes
Certificate subject:
- Common name: www.google.com
- Organization name: Google Inc
Certificate issuer:
- Common name: Google Internet Authority G2
- Organization name: Google Inc
===
HTTP/1.1 302 Found
...
SUBMITTING:
Do not submit something you did not write yourself. You may use short pieces of code you found on the
public Internet, but be sure to mark what is your own code and what is not!
Submit a source package (eg. zip, tar, tar.gz) with both the C/C++ program and your higher-levellanguage program to Rubyric before the deadline. Also include a very short report (a couple of
paragraphs) in which you describe the code you wrote and the functionality or lack of functionality it
has.
The submission URL for this exercise is https://rubyric.cs.hut.fi/submit/999.