aws / aws/aws-cdk

aws-cdk: native boto3/botocore in cdk docker image doesn't have appropriate certificate

Open
#21,882 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-lambda bug effort/small p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

I have a project that creates a lambda function with `aws_cdk.aws_lambda_python_alpha.PythonFunction`. Within the function I make a call via `boto3.Session.client("iot-data")` to `.get_thing_shadow()`, and receive a
```
botocore.exceptions.SSLError: SSL validation failed for https://data.iot.us-west-2.amazonaws.com/things//shadow?name=Cloud [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)
```

The fix here is to install `boto3` in the lambda requirements.txt file, which makes me think that the boto3/botocore package that is native to the Docker image created by aws cdk has an incorrect certificate

### Expected Behavior

I expect the boto3/botocore package that is native to the aws cdk Docker image that is created on `cdk deploy` to have a proper certificate.

### Current Behavior

I recieve a
```
botocore.exceptions.SSLError: SSL validation failed for https://data.iot.us-west-2.amazonaws.com/things//shadow?name=Cloud [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)
```
error

### Reproduction Steps

Included in description

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.39.1 (build f188fac)

### Framework Version

_No response_

### Node.js Version

v16.3.0

### OS

MacOS Monterey 12.0.1

### Language

Python

### Language Version

3.10.2

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the SSL failure from a PythonFunction deployed with cdk deploy, using the boto3.Session.client("iot-data") call described in the report. Compare the native boto3/botocore behavior with the version installed through requirements.txt; done means the native package can call get_thing_shadow() without certificate validation errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, python
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.