Skip to content
>GLB_
Go back

AWS Glue + Chargebee: Diagnosing CERTIFICATE_VERIFY_FAILED After TLS Chain Updates

Context

An AWS Glue job that consumes the Chargebee API begins failing with:

SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: 
unable to get local issuer certificate

The same request works in Postman.

This pattern typically appears after a certificate chain rotation on the API provider side combined with an outdated trust store in the execution environment.

Chargebee announced updates related to its TLS certificate chain (DigiCert G2 becoming permanent in February 2026). When a runtime does not trust the updated intermediate/root CA, SSL validation fails.

Reference:
https://apidocs.chargebee.com/docs/api/getting-started
https://apidocs.chargebee.com/docs/api/tls_certificate_update_g2


Why It Works in Postman but Fails in AWS Glue

The discrepancy is environmental.

Postman

AWS Glue

The Chargebee SDK ultimately uses requests and urllib3, which perform strict certificate validation.


What the Error Actually Means

unable to get local issuer certificate

This does not mean:

It means:

This is a client-side trust issue.


Correct Fix (Production-Safe)

Do not disable SSL verification (verify=False). That bypasses authentication guarantees and exposes credentials to interception.

Instead:

1. Update Dependencies in Glue

In the Glue Job configuration:

Glue Console → Jobs → Your Job → Job details → Default arguments

Add:

--additional-python-modules certifi==2025.1.31,requests==2.32.3,urllib3==2.2.3

This ensures:


2. Force requests to Use certifi

In your Glue script, before any API call:

import os
import certifi

os.environ["REQUESTS_CA_BUNDLE"] = certifi.where()

This ensures that:


Optional: Runtime Verification Debug

Add temporary diagnostics:

import certifi
import requests
import urllib3
import ssl

print("certifi:", certifi.__version__)
print("requests:", requests.__version__)
print("urllib3:", urllib3.__version__)
print("openssl:", ssl.OPENSSL_VERSION)
print("CA bundle:", certifi.where())

If Glue shows an outdated certifi or OpenSSL version compared to your local environment, that explains the discrepancy.


Alternative Root Cause: Corporate TLS Inspection

If your Glue job runs inside a VPC with outbound traffic routed through a proxy performing TLS inspection:

However, if only Chargebee fails and other HTTPS endpoints succeed, the most likely cause is a CA chain update.


Architecture Lesson

Cloud-managed runtimes are not identical to local environments. When an external API rotates its TLS chain:

In distributed data pipelines (Glue, Lambda, Spark), certificate trust management must be treated as part of dependency management.


Summary

The error is almost certainly due to a CA trust mismatch following Chargebee’s TLS chain update.

Postman works because its trust store is current.
Glue fails because its CA bundle is outdated.

Correct remediation:

  1. Update certifi, requests, and urllib3 in Glue.
  2. Explicitly point REQUESTS_CA_BUNDLE to certifi.where().
  3. Avoid disabling SSL verification.

That restores secure TLS validation without compromising integrity.


Share this post:

Previous Post
Can You Know the Location of an IPv6 Address?
Next Post
From OLTP to OLAP: How Data Moves from 3NF to a Dimensional Data Warehouse