WebFund 2015W Lecture 21: Difference between revisions

From Soma-notes
Created page with "==Video== The video for the lecture given on Wednesday, March 25, 2015 [http://homeostasis.scs.carleton.ca/~soma/webfund-2015w/lectures/comp2406-2015w-lec21-25Mar2015.mp4 is ..."
 
LeeCroft (talk | contribs)
No edit summary
 
Line 2: Line 2:


The video for the lecture given on Wednesday, March 25, 2015 [http://homeostasis.scs.carleton.ca/~soma/webfund-2015w/lectures/comp2406-2015w-lec21-25Mar2015.mp4 is now available].
The video for the lecture given on Wednesday, March 25, 2015 [http://homeostasis.scs.carleton.ca/~soma/webfund-2015w/lectures/comp2406-2015w-lec21-25Mar2015.mp4 is now available].
==Notes==
Google uses a ton of cookies when you access their server. They use these for tracking who you are and it is vital to their advertising business. Knowing who you are allows advertisers to show you products that you would buy.
Duckduckgo is another search engine which does not use any cookies!
<h3>TLS/SSL</h3>
<h4>Encryption and certificates</h4>
HTTPS:
<ul>
  <li>Merely HTTP over a secured connection</li>
  <li>Uses port 443 by default</li>
</ul>
With HTTPS, everything is encrypted as it is sent. A server is certified by using an SSL certificate which is digitally signed. This is a security certificate, it identifies that the server you are connecting to is recognized/trusted (not someone who may be intercepting your connection).
These certificates are verified by companies such as DigiCert, and these are called SSL Certificates. You can SAY you are facebook.com, but you can lie about that, so you need someone else to verify your identity. Unfortunately, some certificate authorities can be scams, and issue certificates that are 'spoofed'.
When you see warnings in the browser, this means that there is a problem with the certificate, as it cannot be verified. When this happens, you should check the details of the certificate.
When you are using HTTPS, everyone can see your traffic, but it is completely encrypted, and thus it looks like garbage to everyone.
<h4>HTTPS demo code</h4>
When running the TLS notes demo, the browser says there is a problem with the certificate, and that it isn't valid. It says it is self-signed and expired (usually this == BAD). In this instance, it is ok because we know that we made the certificate so we trust it.
To adapt a previous application to use HTTPS, you must change the <code>require(http)</code> to <code>require(https)</code>. This causes the server to use HTTPS as the protocol instead of HTTP. This is within the bin/www file.
For an HTTPS server, we must specify some options. These options define the public and private keys/certificates. These are loaded using the fs module and store in an options object which is used during the creation of the server.
Keys and certificates can be generated using openSSL. The public key is given out to the clients of the server for them to encrypt data. The private key is used by the server for decryption.

Latest revision as of 20:42, 3 April 2015

Video

The video for the lecture given on Wednesday, March 25, 2015 is now available.

Notes

Google uses a ton of cookies when you access their server. They use these for tracking who you are and it is vital to their advertising business. Knowing who you are allows advertisers to show you products that you would buy.

Duckduckgo is another search engine which does not use any cookies!

TLS/SSL

Encryption and certificates

HTTPS:

  • Merely HTTP over a secured connection
  • Uses port 443 by default

With HTTPS, everything is encrypted as it is sent. A server is certified by using an SSL certificate which is digitally signed. This is a security certificate, it identifies that the server you are connecting to is recognized/trusted (not someone who may be intercepting your connection).

These certificates are verified by companies such as DigiCert, and these are called SSL Certificates. You can SAY you are facebook.com, but you can lie about that, so you need someone else to verify your identity. Unfortunately, some certificate authorities can be scams, and issue certificates that are 'spoofed'.

When you see warnings in the browser, this means that there is a problem with the certificate, as it cannot be verified. When this happens, you should check the details of the certificate.

When you are using HTTPS, everyone can see your traffic, but it is completely encrypted, and thus it looks like garbage to everyone.

HTTPS demo code

When running the TLS notes demo, the browser says there is a problem with the certificate, and that it isn't valid. It says it is self-signed and expired (usually this == BAD). In this instance, it is ok because we know that we made the certificate so we trust it.

To adapt a previous application to use HTTPS, you must change the require(http) to require(https). This causes the server to use HTTPS as the protocol instead of HTTP. This is within the bin/www file.

For an HTTPS server, we must specify some options. These options define the public and private keys/certificates. These are loaded using the fs module and store in an options object which is used during the creation of the server.

Keys and certificates can be generated using openSSL. The public key is given out to the clients of the server for them to encrypt data. The private key is used by the server for decryption.