Problem Statement
When data is sent over the internet without encryption, attackers can intercept and read sensitive information like passwords or credit card numbers. This leads to privacy breaches, data theft, and loss of user trust.
┌───────────────┐ ┌───────────────┐
│ User's │ │ Web Server │
│ Browser │ │ │
└──────┬────────┘ └──────┬────────┘
│ HTTPS Request (Encrypted) │
│─────────────────────────────▶│
│ │
│ HTTPS Response (Encrypted) │
│◀────────────────────────────│This diagram shows encrypted communication between the user's browser and the web server using HTTPS, protecting data in transit.
HTTP and HTTPS?http:// use HTTP, which is not secure.https:// use HTTPS, which is secure and encrypted.1. Client sends HTTP request 2. Server responds with redirect to HTTPS URL 3. Client sends HTTPS request 4. Server sends secure responseWhat is the main purpose of step 2 in this flow?
if url.startswith('http://'):
print('Secure connection')
else:
print('Not secure')
What is the error in this code?Pass the test and this pattern moves unknown