Skip to content

Commit 9b30452

Browse files
Add KVSSINK_CA_CERT_PATH env variable (#1270)
* Add KVSSINK_CA_CERT_PATH env variable to set libcurl certPath in kvssink plugin * Add KVSSINK_CA_CERT_PATH configuration to README.md
1 parent 7771598 commit 9b30452

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,22 @@ To see all `kvssink` parameters, see [AWS Docs - kvssink Paramters](https://docs
322322

323323
For examples of common use cases, see [Example: Kinesis Video Streams Producer SDK GStreamer Plugin](https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/examples-gstreamer-plugin.html).
324324

325+
### Certificate configuration (`KVSSINK_CA_CERT_PATH`)
326+
327+
`kvssink` uses **libcurl** to make HTTP requests to AWS. By default, **libcurl** relies on the system’s standard locations for SSL/TLS certificate verification. In some environments, you may need to override where **libcurl** looks for CA certificates. You can do this by setting the environment variable:
328+
329+
```bash
330+
export KVSSINK_CA_CERT_PATH=/path/to/certs
331+
```
332+
333+
The value can be either:
334+
335+
- **A directory** containing certificate files, or
336+
- **A single certificate file** (with `.pem` extension).
337+
338+
This is particularly useful in restricted or read-only environments—such as certain camera systems that lack CA certificates.
339+
In such cases, you can provide certificate bundle from this repo (`certs/cert.pem`).
340+
325341
<br>
326342

327343
## Java Native Interface (JNI)

src/gstreamer/KvsSinkDeviceInfoProvider.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "KvsSinkDeviceInfoProvider.h"
2+
#include <cstdlib>
23

34
using namespace com::amazonaws::kinesis::video;
45

@@ -11,3 +12,11 @@ KvsSinkDeviceInfoProvider::device_info_t KvsSinkDeviceInfoProvider::getDeviceInf
1112
device_info.clientInfo.serviceCallConnectionTimeout = static_cast<UINT64>(service_call_connection_timeout_sec_ * HUNDREDS_OF_NANOS_IN_A_SECOND);
1213
return device_info;
1314
}
15+
16+
const std::string KvsSinkDeviceInfoProvider::getCertPath() {
17+
static const std::string cert_path = []() {
18+
const char* env_path = std::getenv("KVSSINK_CA_CERT_PATH");
19+
return env_path != nullptr ? std::string(env_path) : "";
20+
}();
21+
return cert_path;
22+
}

src/gstreamer/KvsSinkDeviceInfoProvider.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace com { namespace amazonaws { namespace kinesis { namespace video {
1919
service_call_connection_timeout_sec_(service_call_connection_timeout_sec),
2020
service_call_completion_timeout_sec_(service_call_completion_timeout_sec) {}
2121
device_info_t getDeviceInfo() override;
22+
const std::string getCertPath() override;
2223
};
2324
}
2425
}

0 commit comments

Comments
 (0)