TLS & HTTPS with Python - Digital Certificates

preview_player
Показать описание
In this video, you will learn how to create self-signed certificates in Python to use with TLS encryption.
Normally, to use signed digital certificates in public key infrastructure (PKI) , you need a device connected to the internet, a valid domain name and quite often you need to pay a fee to a Certificate Authority to sign the cert.

Now, we are going to learn how to create and sign our own certificates, without a domain name or paying any fee, so that we may implement TLS on our internal servers.

So, why on earth would you want to create and sign your own certificates?

• Well, you may just want to secure traffic to a local server on your network, that you already trust, but you don’t have a domain name or don’t want buy certs.
• If you’re a developer, you may need to have your development servers emulate your production servers that are running HTTPS
• Or, you may simply want to know how to setup and configure TLS and don’t have a public web site or domain

Whatever the reason, I will show you how to create a self-signed certificate in Python and how to install on your server and browser to connect over https.

So, for example, we have a server here on our local network that is running web services. It only has an IP address. We trust this server because it’s on our local network and does not provide services to the internet. However, there is come confidential information on the server and our users are accessing it via logins and passwords. Therefore, we want the internal traffic going to the server to be encrypted.

First we’ll create the certificate and private key in Python our client computer
Then we’ll copy the cert and key to the web server running apache
We’ll configure the server to use our cert and we’ll import the cert into our browsers.
finally we’ll test the connection
Рекомендации по теме
Комментарии
Автор

Thank you so much for your video. I played around with the code and now I have a better understanding.

MsEady
Автор

Where do you create or find a 'server_IP'?

newwarrior-wify
Автор

The cert and key still error when i bring them in python script:
requests.post(url, payload=payload, cert=('ssl/certificate.crt', 'ssl/certificate.key'))

It said: ssl failed _ssl1045
Would you mind helping me?
Notes:
- in generate cert and key python script, the ip address has been fullfiled with my ipv4 address. h_name: ca_server
- I use Laragon as local server app
- I have changed apache2 ssl to the cert file and key file.

candrasniper