SlideShare a Scribd company logo
1 of 27
Download to read offline
HTTPS and Certificates explained 
31st of July 2014 
What is it? How does it work? 
by Pierre Cornic
31st of July 2014 
Table of content 
1. Why HTTPS? 
2. Public/private key, encrypt, sign 
3. Certificate authority & PKI 
4. Let’s use it
31st of July 2014 
Why HTTPS 
Bi-directional encryption of communication 
For example: ARP spoofing 
Attacker cannot decrypt data
31st of July 2014 
Why HTTPS 
Validate identity of remote server 
For example: DNS poisoning 
Client sees a certificate warning when accessing fake site
31st of July 2014 
Table of content 
1. Why HTTPS? 
2. Public/private key, encrypt, sign 
3. Certificate authority & PKI 
4. Let’s use it
31st of July 2014 
Public/private key encryption 
● Encrypt with public key 
● Decrypt with private key 
Source: wikipedia
31st of July 2014 
Public/private key encryption 
● Encrypt hash with private key 
● Decrypt with public key 
Source: wikipedia
31st of July 2014 
Table of content 
1. Why HTTPS? 
2. Public/private key, encrypt, sign 
3. Certificate authority & PKI 
4. Let’s use it
31st of July 2014 
Certificate Authority 
● Binds a certificate to an identity 
Inovia-Team 
Certificate Authority 
(Trusted Tier Party) 
Private key 
Checks that the person that owns 
private key is Inovia-Team 
Creates & signs 
Certificate = Public key + Inovia-Team
31st of July 2014 
What is inside a x509 certificate? 
$ openssl x509 -in inovia.fr.crt -noout -text 
Version: 3 (0x2) 
Serial Number: 92675 (0x16a03) 
Signature Algorithm: sha1WithRSAEncryption 
Issuer: C=IL, O=StartCom Ltd., OU=Secure Digital Certificate Signing, CN=StartCom Class 2 Primary Intermediate Server CA 
Validity 
Not Before: May 23 01:18:37 2013 GMT 
Not After : May 23 19:03:12 2015 GMT 
Subject: description=zyBDci1AcdG79M0X, C=FR, ST=Ile-de-France, L=PARIS, O=Inovia-Team SARL, CN=inovia.fr/emailAddress=webmaster@inovia-team.com 
Subject Public Key Info: 
Public Key Algorithm: rsaEncryption 
RSA Public Key: (2048 bit) 
Modulus (2048 bit): 
00:e5:2b:b0:66:ac:f5:22:5b:64:b5:19:58:25:c3: 
[………] 
Exponent: 65537 (0x10001) 
X509v3 extensions: 
X509v3 Basic Constraints: 
CA:FALSE 
X509v3 Key Usage: 
Digital Signature, Key Encipherment, Key Agreement 
X509v3 Extended Key Usage: 
TLS Web Client Authentication, TLS Web Server Authentication 
X509v3 Subject Key Identifier: 
E7:39:36:3C:96:C6:AA:C2:83:73:7E:8A:4E:1B:9C:9B:34:C6:52:7D 
X509v3 Authority Key Identifier: 
keyid:11:DB:23:45:FD:54:CC:6A:71:6F:84:8A:03:D7:BE:F7:01:2F:26:86 
Certificate authority 
Subject: Inovia-Team 
Public key
31st of July 2014 
What is inside a x509 certificate? 
X509v3 Subject Alternative Name: 
DNS:inovia.fr, DNS:inovia-team.com, DNS:*.inovia-team.com, DNS:*.inovia-team.com, DNS:*.inovia.fr 
X509v3 Certificate Policies: 
Policy: 2.23.140.1.2.2 
Policy: 1.3.6.1.4.1.23223.1.2.3 
CPS: http://www.startssl.com/policy.pdf 
User Notice: 
Organization: StartCom Certification Authority 
Number: 1 
Explicit Text: This certificate was issued according to the Class 2 Validation requirements of the StartCom CA policy, reliance only for the intended purpose in 
compliance of the relying party obligations. 
X509v3 CRL Distribution Points: 
URI:http://crl.startssl.com/crt2-crl.crl 
Authority Information Access: 
OCSP - URI:http://ocsp.startssl.com/sub/class2/server/ca 
CA Issuers - URI:http://aia.startssl.com/certs/sub.class2.server.ca.crt 
X509v3 Issuer Alternative Name: 
URI:http://www.startssl.com/ 
Signature Algorithm: sha1WithRSAEncryption 
7d:a9:eb:10:28:6a:75:a2:65:f6:7b:38:13:c4:f4:61:f6:43: 
[...] 
46:72:3f:e8:b3:1f:0f:ab:56:25:1d:6a:cb:5d:78:c0:b8:e1: 
b5:58:95:bd 
Subject other names 
Signature using CA private key
31st of July 2014 
Verify certificate 
● Retrieve CA certificate 
● Decrypt CA_to_validate signature using CA public key 
● Hash CA_to_validate data 
● Check that both hash are the same 
To verify a certificate I need another certificate. 
HOW CAN I TRUST IT???
31st of July 2014 
Public Key Infrastructure 
● Chain of trust
31st of July 2014 
Public Key Infrastructure 
Major Root Certificates 
are preinstalled in 
browsers and operating 
systems
31st of July 2014 
Public Key Infrastructure 
Major Root Certificates 
are preinstalled in 
browsers and operating 
systems
31st of July 2014 
Table of content 
1. Why HTTPS? 
2. Public/private key, encrypt, sign 
3. Certificate authority & PKI 
4. Let’s use it
31st of July 2014 
Use case: enable SSL for a team of 
developers 
● 10 devs 
● Application installed on each workstation 
● Each dev must be able to access another dev 
workstation without certificate warning 
● Do not want to pay 10 certificates! 
Solution: Create your own CA!
31st of July 2014 
Let’s use it: create your own CA 
● Generate password-protected CA Key 
$ openssl genrsa -out rootCA.key 2048 -des3 
● Generate CA Certificate 
$ openssl req -x509 -new -nodes -key rootCA.key -days 1024 -out rootCA.pem 
You are about to be asked to enter information that will be incorporated into your certificate 
request. What you are about to enter is what is called a Distinguished Name or a DN. 
There are quite a few fields but you can leave some blank 
For some fields there will be a default value, 
If you enter '.', the field will be left blank. 
----- 
Country Name (2 letter code) [AU]:FR 
State or Province Name (full name) [Some-State]:Ile-de-France 
Locality Name (eg, city) []:Paris 
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Inovia-Team 
Organizational Unit Name (eg, section) []:IT Department 
Common Name (e.g. server FQDN or YOUR name) []:Inovia Certificate Authority 
Email Address []:
31st of July 2014 
Signature flow 
Obtaining certificate from a CA 
Certificate signing request 
Certificate Authority 
HTTP Server <- Certificate 
Client Application <- CA’s credentials 
CA receives a Certificate 
Signing Request 
CA creates a Certificate which is 
placed on the HTTP server 
Client connects to the server over HTTPS and 
verifies that the server’s Certificate signature 
matches the trusted CA’s credentials.
Create Certificate Signing Request 
31st of July 2014 
● Generate Key 
$ openssl genrsa -out mywebsite.key 2048 
● Generate Certificate Signing Request (CSR) 
$ openssl req -new -key mywebsite.key -days -out mywebsite.csr 
You are about to be asked to enter information that will be incorporated into your certificate 
request. What you are about to enter is what is called a Distinguished Name or a DN. 
There are quite a few fields but you can leave some blank 
For some fields there will be a default value, 
If you enter '.', the field will be left blank. 
----- 
Country Name (2 letter code) [AU]:FR 
State or Province Name (full name) [Some-State]:Ile-de-France 
Locality Name (eg, city) []:Paris 
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Inovia-Team 
Organizational Unit Name (eg, section) []:MyTeam 
Common Name (e.g. server FQDN or YOUR name) []:*.myhostname.local 
Email Address []:
31st of July 2014 
Generate certificate from CSR 
● Send CSR to IT Department 
● Generate Certificate 
$ openssl x509 -req -in mywebsite.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial - 
out mywebsite.crt -days 500 
Signature ok 
subject=/C=FR/ST=Ile-de-France/L=Paris/O=Inovia-Team/OU=MyTeam/CN=*.myhostname. 
local 
Getting CA Private Key 
● Verify certificate using your CA 
$ openssl verify -CAfile rootCA.pem mywebsite.crt 
mywebsite.crt: OK
31st of July 2014 
Verify certificate 
$ openssl x509 -in mywebsite.crt -noout -text 
Certificate: 
Data: 
Version: 1 (0x0) 
Serial Number: 
92:72:d1:12:be:f4:07:8e 
Signature Algorithm: sha1WithRSAEncryption 
Issuer: C=FR, ST=Ile-de-France, L=Paris, O=Inovia-Team, OU=IT Department, CN=Inovia Certificate Authority 
Validity 
Not Before: Jul 31 12:32:41 2014 GMT 
Not After : Dec 13 12:32:41 2015 GMT 
Subject: C=FR, ST=Ile-de-France, L=Paris, O=Inovia-Team, OU=MyTeam, CN=*.myhostname.local 
Subject Public Key Info: 
Public Key Algorithm: rsaEncryption 
RSA Public Key: (2048 bit) 
Modulus (2048 bit): 
00:d0:bd:82:bc:9c:36:ea:7e:a3:ee:c5:86:70:e5: 
[...] 
22:0b:72:fc:46:ac:aa:6d:76:e4:2b:1c:09:1e:78: 
6e:bd:81:a1:57:03:f8:91:7e:54:8b:38:9e:ec:19: 
e3:27 
Exponent: 65537 (0x10001) 
Signature Algorithm: sha1WithRSAEncryption 
b6:d5:74:81:26:96:8a:37:51:c0:33:97:c5:65:c3:8a:f5:94: 
[...] 
90:fc:c8:8d:e1:2b:4f:c7:fd:6d:8c:f7:3b:0e:fd:42:86:8e:
31st of July 2014 
Install in Apache 
● Create a VirtualHost 
<VirtualHost *:443> 
ServerName mywebsite.myhostname.local 
DocumentRoot /var/www/mywebsite/ 
SSLEngine on 
SSLCertificateFile /etc/apache2/ssl/mywebsite.crt 
SSLCertificateKeyFile /etc/apache2/ssl/mywebsite.key 
SSLCertificateChainFile /etc/apache2/ssl/rootCA.pem 
</VirtualHost> 
● Enable virtualhost & restart apache 
# a2ensite mywebsite 
# a2enmod ssl 
# apache2ctl -t 
# apache2ctl restart 
Is that all?
Install CA certificate on all browsers 
● Chrome: Parameters > Display advanced parameters > 
31st of July 2014 
Manage certificates > Root certificates > Import 
● Firefox: Tools > Preferences > Advanced > Certificates 
> Display certificates > Import 
● OS: If you use Webservices for example 
$ sudo cp rootCA.crt /usr/share/ca-certificates/ 
$ sudo update-ca-certificates
31st of July 2014 
Questions ? 
For online questions, please leave a comment on the article.
31st of July 2014 
Join the community ! 
(in Paris) 
Social networks : 
● Follow us on Twitter : https://twitter.com/steamlearn 
● Like us on Facebook : https://www.facebook.com/steamlearn 
SteamLearn is an Inovia initiative : inovia.fr 
You wish to be in the audience ? Contact us at 
learn@steamhouse.fr
31st of July 2014 
Sources 
http://securitymusings.com (images) 
http://www.technicalinfo.net/papers/images/pharming030.jpg (images) 
http://dm3.github.io/(images) 
http://technet.microsoft.com/ (images) 
http://icons.iconarchive.com (images) 
www.flaticon.com (images)

More Related Content

What's hot

Cryptography for Smalltalkers 2 - ESUG 2006
Cryptography for Smalltalkers 2 - ESUG 2006Cryptography for Smalltalkers 2 - ESUG 2006
Cryptography for Smalltalkers 2 - ESUG 2006
Martin Kobetic
 

What's hot (17)

A New Pairing Free ID Based Certificate Less Digital Signature (CL-DS) Scheme...
A New Pairing Free ID Based Certificate Less Digital Signature (CL-DS) Scheme...A New Pairing Free ID Based Certificate Less Digital Signature (CL-DS) Scheme...
A New Pairing Free ID Based Certificate Less Digital Signature (CL-DS) Scheme...
 
Technology, Process, and Strategy
Technology, Process, and StrategyTechnology, Process, and Strategy
Technology, Process, and Strategy
 
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
 
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
 
Crypography in c#
Crypography in c#Crypography in c#
Crypography in c#
 
DNSSEC Validation Tutorial
DNSSEC Validation TutorialDNSSEC Validation Tutorial
DNSSEC Validation Tutorial
 
Hitcon badge 2018
Hitcon badge 2018 Hitcon badge 2018
Hitcon badge 2018
 
NextGenPSD2 OAuth SCA Mode Security Recommendations
NextGenPSD2 OAuth SCA Mode Security Recommendations NextGenPSD2 OAuth SCA Mode Security Recommendations
NextGenPSD2 OAuth SCA Mode Security Recommendations
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITY
 
Basics of ssl
Basics of sslBasics of ssl
Basics of ssl
 
Pgp smime
Pgp smimePgp smime
Pgp smime
 
Network security cs8
Network security  cs8Network security  cs8
Network security cs8
 
Wi-Foo Ninjitsu Exploitation
Wi-Foo Ninjitsu ExploitationWi-Foo Ninjitsu Exploitation
Wi-Foo Ninjitsu Exploitation
 
Building basic public key infrastucture (PKI)
Building basic public key infrastucture (PKI)Building basic public key infrastucture (PKI)
Building basic public key infrastucture (PKI)
 
Geth important commands
Geth important commandsGeth important commands
Geth important commands
 
Secure 3 kany-vanda
Secure 3 kany-vandaSecure 3 kany-vanda
Secure 3 kany-vanda
 
Cryptography for Smalltalkers 2 - ESUG 2006
Cryptography for Smalltalkers 2 - ESUG 2006Cryptography for Smalltalkers 2 - ESUG 2006
Cryptography for Smalltalkers 2 - ESUG 2006
 

Viewers also liked

Infraestructura pki
Infraestructura pkiInfraestructura pki
Infraestructura pki
gcalahorrano
 

Viewers also liked (8)

Report from IETF 89 in London - DNS, DHCP and IPv6
Report from IETF 89 in London - DNS, DHCP and IPv6Report from IETF 89 in London - DNS, DHCP and IPv6
Report from IETF 89 in London - DNS, DHCP and IPv6
 
Http, https, dns
Http, https, dnsHttp, https, dns
Http, https, dns
 
HTTPS -Ana Isabel Garcia Palacios-
HTTPS -Ana Isabel Garcia Palacios-HTTPS -Ana Isabel Garcia Palacios-
HTTPS -Ana Isabel Garcia Palacios-
 
Infraestructura pki
Infraestructura pkiInfraestructura pki
Infraestructura pki
 
Infraestructura PKI
Infraestructura PKIInfraestructura PKI
Infraestructura PKI
 
Protocolo http y WWW
Protocolo http y WWWProtocolo http y WWW
Protocolo http y WWW
 
Presentacion HTTP/HTTPS/DNS
Presentacion HTTP/HTTPS/DNSPresentacion HTTP/HTTPS/DNS
Presentacion HTTP/HTTPS/DNS
 
PROTOCOLO HTTPS
PROTOCOLO HTTPSPROTOCOLO HTTPS
PROTOCOLO HTTPS
 

Similar to Steam Learn: HTTPS and certificates explained

Digital certificates
Digital certificates Digital certificates
Digital certificates
Sheetal Verma
 

Similar to Steam Learn: HTTPS and certificates explained (20)

#MoreCrypto : Introduction to TLS
#MoreCrypto : Introduction to TLS#MoreCrypto : Introduction to TLS
#MoreCrypto : Introduction to TLS
 
Oralce SSL walelt -TCPS_Troubleshooting_PB.pptx
Oralce SSL walelt -TCPS_Troubleshooting_PB.pptxOralce SSL walelt -TCPS_Troubleshooting_PB.pptx
Oralce SSL walelt -TCPS_Troubleshooting_PB.pptx
 
#Morecrypto 1.8 - with introduction to TLS
#Morecrypto 1.8 - with introduction to TLS#Morecrypto 1.8 - with introduction to TLS
#Morecrypto 1.8 - with introduction to TLS
 
OpenID 4 Verifiable Credentials + HAIP (Update)
OpenID 4 Verifiable Credentials + HAIP (Update)OpenID 4 Verifiable Credentials + HAIP (Update)
OpenID 4 Verifiable Credentials + HAIP (Update)
 
Cisco Connect Ottawa 2018 secure on prem
Cisco Connect Ottawa 2018 secure on premCisco Connect Ottawa 2018 secure on prem
Cisco Connect Ottawa 2018 secure on prem
 
Raconte-moi X.509 : anatomie d'une autorité de certification
Raconte-moi X.509 : anatomie d'une autorité de certificationRaconte-moi X.509 : anatomie d'une autorité de certification
Raconte-moi X.509 : anatomie d'une autorité de certification
 
Auth proxy pattern on Kubernetes
Auth proxy pattern on KubernetesAuth proxy pattern on Kubernetes
Auth proxy pattern on Kubernetes
 
U2F/FIDO2 implementation of YubiKey
U2F/FIDO2 implementation of YubiKeyU2F/FIDO2 implementation of YubiKey
U2F/FIDO2 implementation of YubiKey
 
[Cluj] Turn SSL ON
[Cluj] Turn SSL ON[Cluj] Turn SSL ON
[Cluj] Turn SSL ON
 
Introduction to Public Key Infrastructure
Introduction to Public Key InfrastructureIntroduction to Public Key Infrastructure
Introduction to Public Key Infrastructure
 
Secure socket layer
Secure socket layerSecure socket layer
Secure socket layer
 
O365Con19 - A Life Without Passwords Dream or Reality - Sander Berkouwer
O365Con19 - A Life Without Passwords Dream or Reality - Sander BerkouwerO365Con19 - A Life Without Passwords Dream or Reality - Sander Berkouwer
O365Con19 - A Life Without Passwords Dream or Reality - Sander Berkouwer
 
Secure Gate / Reverse Proxy - WAF 1ere génération / Datelec
Secure Gate / Reverse Proxy - WAF 1ere génération / DatelecSecure Gate / Reverse Proxy - WAF 1ere génération / Datelec
Secure Gate / Reverse Proxy - WAF 1ere génération / Datelec
 
OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...
OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...
OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...
 
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
 
Security Theatre - PHP UK Conference
Security Theatre - PHP UK ConferenceSecurity Theatre - PHP UK Conference
Security Theatre - PHP UK Conference
 
SSL and CA
SSL and CASSL and CA
SSL and CA
 
February 2016 Webinar Series - Best Practices for IoT Security in the Cloud
February 2016 Webinar Series - Best Practices for IoT Security in the CloudFebruary 2016 Webinar Series - Best Practices for IoT Security in the Cloud
February 2016 Webinar Series - Best Practices for IoT Security in the Cloud
 
Global Azure Bootcamp 2017 - Azure Key Vault
Global Azure Bootcamp 2017 - Azure Key VaultGlobal Azure Bootcamp 2017 - Azure Key Vault
Global Azure Bootcamp 2017 - Azure Key Vault
 
Digital certificates
Digital certificates Digital certificates
Digital certificates
 

More from inovia

More from inovia (20)

10 tips for Redux at scale
10 tips for Redux at scale10 tips for Redux at scale
10 tips for Redux at scale
 
10 essentials steps for kafka streaming services
10 essentials steps for kafka streaming services10 essentials steps for kafka streaming services
10 essentials steps for kafka streaming services
 
Redux at scale
Redux at scaleRedux at scale
Redux at scale
 
DocuSign's Road to react
DocuSign's Road to reactDocuSign's Road to react
DocuSign's Road to react
 
API Gateway: Nginx way
API Gateway: Nginx wayAPI Gateway: Nginx way
API Gateway: Nginx way
 
Kafka: meetup microservice
Kafka: meetup microserviceKafka: meetup microservice
Kafka: meetup microservice
 
Microservice: starting point
Microservice:  starting pointMicroservice:  starting point
Microservice: starting point
 
Correlation id (tid)
Correlation id (tid)Correlation id (tid)
Correlation id (tid)
 
Meetic back end redesign - Meetup microservices
Meetic back end redesign - Meetup microservicesMeetic back end redesign - Meetup microservices
Meetic back end redesign - Meetup microservices
 
Security in microservices architectures
Security in microservices architecturesSecurity in microservices architectures
Security in microservices architectures
 
Building a Secure, Performant Network Fabric for Microservice Applications
Building a Secure, Performant Network Fabric for Microservice ApplicationsBuilding a Secure, Performant Network Fabric for Microservice Applications
Building a Secure, Performant Network Fabric for Microservice Applications
 
Microservices vs SOA
Microservices vs SOAMicroservices vs SOA
Microservices vs SOA
 
CQRS, an introduction by JC Bohin
CQRS, an introduction by JC BohinCQRS, an introduction by JC Bohin
CQRS, an introduction by JC Bohin
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Oauth2, open-id connect with microservices
Oauth2, open-id connect with microservicesOauth2, open-id connect with microservices
Oauth2, open-id connect with microservices
 
You probably don't need microservices
You probably don't need microservicesYou probably don't need microservices
You probably don't need microservices
 
Api Gateway - What's the use of an api gateway?
Api Gateway - What's the use of an api gateway?Api Gateway - What's the use of an api gateway?
Api Gateway - What's the use of an api gateway?
 
Steam Learn: An introduction to Redis
Steam Learn: An introduction to RedisSteam Learn: An introduction to Redis
Steam Learn: An introduction to Redis
 
Steam Learn: Speedrun et TAS
Steam Learn: Speedrun et TASSteam Learn: Speedrun et TAS
Steam Learn: Speedrun et TAS
 
Steam Learn: Asynchronous Javascript
Steam Learn: Asynchronous JavascriptSteam Learn: Asynchronous Javascript
Steam Learn: Asynchronous Javascript
 

Recently uploaded

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Recently uploaded (20)

WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 

Steam Learn: HTTPS and certificates explained

  • 1. HTTPS and Certificates explained 31st of July 2014 What is it? How does it work? by Pierre Cornic
  • 2. 31st of July 2014 Table of content 1. Why HTTPS? 2. Public/private key, encrypt, sign 3. Certificate authority & PKI 4. Let’s use it
  • 3. 31st of July 2014 Why HTTPS Bi-directional encryption of communication For example: ARP spoofing Attacker cannot decrypt data
  • 4. 31st of July 2014 Why HTTPS Validate identity of remote server For example: DNS poisoning Client sees a certificate warning when accessing fake site
  • 5. 31st of July 2014 Table of content 1. Why HTTPS? 2. Public/private key, encrypt, sign 3. Certificate authority & PKI 4. Let’s use it
  • 6. 31st of July 2014 Public/private key encryption ● Encrypt with public key ● Decrypt with private key Source: wikipedia
  • 7. 31st of July 2014 Public/private key encryption ● Encrypt hash with private key ● Decrypt with public key Source: wikipedia
  • 8. 31st of July 2014 Table of content 1. Why HTTPS? 2. Public/private key, encrypt, sign 3. Certificate authority & PKI 4. Let’s use it
  • 9. 31st of July 2014 Certificate Authority ● Binds a certificate to an identity Inovia-Team Certificate Authority (Trusted Tier Party) Private key Checks that the person that owns private key is Inovia-Team Creates & signs Certificate = Public key + Inovia-Team
  • 10. 31st of July 2014 What is inside a x509 certificate? $ openssl x509 -in inovia.fr.crt -noout -text Version: 3 (0x2) Serial Number: 92675 (0x16a03) Signature Algorithm: sha1WithRSAEncryption Issuer: C=IL, O=StartCom Ltd., OU=Secure Digital Certificate Signing, CN=StartCom Class 2 Primary Intermediate Server CA Validity Not Before: May 23 01:18:37 2013 GMT Not After : May 23 19:03:12 2015 GMT Subject: description=zyBDci1AcdG79M0X, C=FR, ST=Ile-de-France, L=PARIS, O=Inovia-Team SARL, CN=inovia.fr/emailAddress=webmaster@inovia-team.com Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (2048 bit) Modulus (2048 bit): 00:e5:2b:b0:66:ac:f5:22:5b:64:b5:19:58:25:c3: [………] Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE X509v3 Key Usage: Digital Signature, Key Encipherment, Key Agreement X509v3 Extended Key Usage: TLS Web Client Authentication, TLS Web Server Authentication X509v3 Subject Key Identifier: E7:39:36:3C:96:C6:AA:C2:83:73:7E:8A:4E:1B:9C:9B:34:C6:52:7D X509v3 Authority Key Identifier: keyid:11:DB:23:45:FD:54:CC:6A:71:6F:84:8A:03:D7:BE:F7:01:2F:26:86 Certificate authority Subject: Inovia-Team Public key
  • 11. 31st of July 2014 What is inside a x509 certificate? X509v3 Subject Alternative Name: DNS:inovia.fr, DNS:inovia-team.com, DNS:*.inovia-team.com, DNS:*.inovia-team.com, DNS:*.inovia.fr X509v3 Certificate Policies: Policy: 2.23.140.1.2.2 Policy: 1.3.6.1.4.1.23223.1.2.3 CPS: http://www.startssl.com/policy.pdf User Notice: Organization: StartCom Certification Authority Number: 1 Explicit Text: This certificate was issued according to the Class 2 Validation requirements of the StartCom CA policy, reliance only for the intended purpose in compliance of the relying party obligations. X509v3 CRL Distribution Points: URI:http://crl.startssl.com/crt2-crl.crl Authority Information Access: OCSP - URI:http://ocsp.startssl.com/sub/class2/server/ca CA Issuers - URI:http://aia.startssl.com/certs/sub.class2.server.ca.crt X509v3 Issuer Alternative Name: URI:http://www.startssl.com/ Signature Algorithm: sha1WithRSAEncryption 7d:a9:eb:10:28:6a:75:a2:65:f6:7b:38:13:c4:f4:61:f6:43: [...] 46:72:3f:e8:b3:1f:0f:ab:56:25:1d:6a:cb:5d:78:c0:b8:e1: b5:58:95:bd Subject other names Signature using CA private key
  • 12. 31st of July 2014 Verify certificate ● Retrieve CA certificate ● Decrypt CA_to_validate signature using CA public key ● Hash CA_to_validate data ● Check that both hash are the same To verify a certificate I need another certificate. HOW CAN I TRUST IT???
  • 13. 31st of July 2014 Public Key Infrastructure ● Chain of trust
  • 14. 31st of July 2014 Public Key Infrastructure Major Root Certificates are preinstalled in browsers and operating systems
  • 15. 31st of July 2014 Public Key Infrastructure Major Root Certificates are preinstalled in browsers and operating systems
  • 16. 31st of July 2014 Table of content 1. Why HTTPS? 2. Public/private key, encrypt, sign 3. Certificate authority & PKI 4. Let’s use it
  • 17. 31st of July 2014 Use case: enable SSL for a team of developers ● 10 devs ● Application installed on each workstation ● Each dev must be able to access another dev workstation without certificate warning ● Do not want to pay 10 certificates! Solution: Create your own CA!
  • 18. 31st of July 2014 Let’s use it: create your own CA ● Generate password-protected CA Key $ openssl genrsa -out rootCA.key 2048 -des3 ● Generate CA Certificate $ openssl req -x509 -new -nodes -key rootCA.key -days 1024 -out rootCA.pem You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:FR State or Province Name (full name) [Some-State]:Ile-de-France Locality Name (eg, city) []:Paris Organization Name (eg, company) [Internet Widgits Pty Ltd]:Inovia-Team Organizational Unit Name (eg, section) []:IT Department Common Name (e.g. server FQDN or YOUR name) []:Inovia Certificate Authority Email Address []:
  • 19. 31st of July 2014 Signature flow Obtaining certificate from a CA Certificate signing request Certificate Authority HTTP Server <- Certificate Client Application <- CA’s credentials CA receives a Certificate Signing Request CA creates a Certificate which is placed on the HTTP server Client connects to the server over HTTPS and verifies that the server’s Certificate signature matches the trusted CA’s credentials.
  • 20. Create Certificate Signing Request 31st of July 2014 ● Generate Key $ openssl genrsa -out mywebsite.key 2048 ● Generate Certificate Signing Request (CSR) $ openssl req -new -key mywebsite.key -days -out mywebsite.csr You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:FR State or Province Name (full name) [Some-State]:Ile-de-France Locality Name (eg, city) []:Paris Organization Name (eg, company) [Internet Widgits Pty Ltd]:Inovia-Team Organizational Unit Name (eg, section) []:MyTeam Common Name (e.g. server FQDN or YOUR name) []:*.myhostname.local Email Address []:
  • 21. 31st of July 2014 Generate certificate from CSR ● Send CSR to IT Department ● Generate Certificate $ openssl x509 -req -in mywebsite.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial - out mywebsite.crt -days 500 Signature ok subject=/C=FR/ST=Ile-de-France/L=Paris/O=Inovia-Team/OU=MyTeam/CN=*.myhostname. local Getting CA Private Key ● Verify certificate using your CA $ openssl verify -CAfile rootCA.pem mywebsite.crt mywebsite.crt: OK
  • 22. 31st of July 2014 Verify certificate $ openssl x509 -in mywebsite.crt -noout -text Certificate: Data: Version: 1 (0x0) Serial Number: 92:72:d1:12:be:f4:07:8e Signature Algorithm: sha1WithRSAEncryption Issuer: C=FR, ST=Ile-de-France, L=Paris, O=Inovia-Team, OU=IT Department, CN=Inovia Certificate Authority Validity Not Before: Jul 31 12:32:41 2014 GMT Not After : Dec 13 12:32:41 2015 GMT Subject: C=FR, ST=Ile-de-France, L=Paris, O=Inovia-Team, OU=MyTeam, CN=*.myhostname.local Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (2048 bit) Modulus (2048 bit): 00:d0:bd:82:bc:9c:36:ea:7e:a3:ee:c5:86:70:e5: [...] 22:0b:72:fc:46:ac:aa:6d:76:e4:2b:1c:09:1e:78: 6e:bd:81:a1:57:03:f8:91:7e:54:8b:38:9e:ec:19: e3:27 Exponent: 65537 (0x10001) Signature Algorithm: sha1WithRSAEncryption b6:d5:74:81:26:96:8a:37:51:c0:33:97:c5:65:c3:8a:f5:94: [...] 90:fc:c8:8d:e1:2b:4f:c7:fd:6d:8c:f7:3b:0e:fd:42:86:8e:
  • 23. 31st of July 2014 Install in Apache ● Create a VirtualHost <VirtualHost *:443> ServerName mywebsite.myhostname.local DocumentRoot /var/www/mywebsite/ SSLEngine on SSLCertificateFile /etc/apache2/ssl/mywebsite.crt SSLCertificateKeyFile /etc/apache2/ssl/mywebsite.key SSLCertificateChainFile /etc/apache2/ssl/rootCA.pem </VirtualHost> ● Enable virtualhost & restart apache # a2ensite mywebsite # a2enmod ssl # apache2ctl -t # apache2ctl restart Is that all?
  • 24. Install CA certificate on all browsers ● Chrome: Parameters > Display advanced parameters > 31st of July 2014 Manage certificates > Root certificates > Import ● Firefox: Tools > Preferences > Advanced > Certificates > Display certificates > Import ● OS: If you use Webservices for example $ sudo cp rootCA.crt /usr/share/ca-certificates/ $ sudo update-ca-certificates
  • 25. 31st of July 2014 Questions ? For online questions, please leave a comment on the article.
  • 26. 31st of July 2014 Join the community ! (in Paris) Social networks : ● Follow us on Twitter : https://twitter.com/steamlearn ● Like us on Facebook : https://www.facebook.com/steamlearn SteamLearn is an Inovia initiative : inovia.fr You wish to be in the audience ? Contact us at learn@steamhouse.fr
  • 27. 31st of July 2014 Sources http://securitymusings.com (images) http://www.technicalinfo.net/papers/images/pharming030.jpg (images) http://dm3.github.io/(images) http://technet.microsoft.com/ (images) http://icons.iconarchive.com (images) www.flaticon.com (images)