</>

Technology

Rest Assured

Difficulty

Beginner

Interview Question

What is HTTP vs HTTPS and what are the key differences?

Answer

HTTP vs HTTPS

FeatureHTTPHTTPS
Full formHyperText Transfer ProtocolHyperText Transfer Protocol Secure
URL prefixhttp://https://
Port80443
SecurityUnsecuredSecured
LayerApplication LayerTransport Layer (SSL/TLS)
EncryptionAbsentPresent (SSL/TLS)
CertificatesNot requiredRequires SSL Certificate
Data integrityCan be tamperedProtected from tampering

Why HTTPS Matters in API Testing

  • Ensures data transmitted between client and server is encrypted
  • Prevents man-in-the-middle attacks
  • Required for APIs handling sensitive data (auth tokens, passwords, PII)
  • Modern APIs should always use HTTPS

Practical Implication in Rest Assured

Java
// HTTPS API call — Rest Assured handles SSL by default
Response response = given()
    .relaxedHTTPSValidation() // bypass SSL cert verification in test env
    .when()
    .get("https://api.example.com/users");

In Interviews

  • APIs in production should always use HTTPS
  • If testing against a self-signed cert environment, use relaxedHTTPSValidation()
  • HTTP is only acceptable in local development

Follow AutomateQA

Related Topics