aboutsummaryrefslogtreecommitdiff
path: root/src/filemanager.cpp
diff options
context:
space:
mode:
authorAlan D. Snow <alansnow21@gmail.com>2020-08-16 05:30:58 -0500
committerGitHub <noreply@github.com>2020-08-16 12:30:58 +0200
commite1dc2d5516562c2e6e9668325d897c0eccdc6d2a (patch)
tree0e5da750934ae01c11af2acb8edbf460c6ee2b50 /src/filemanager.cpp
parentb8c198897da30e59d41f7b9ccb66bc1b0079e5d8 (diff)
downloadPROJ-e1dc2d5516562c2e6e9668325d897c0eccdc6d2a.tar.gz
PROJ-e1dc2d5516562c2e6e9668325d897c0eccdc6d2a.zip
ENH: Add support for custum CA Bundle path (#2323)
Fixes #2320
Diffstat (limited to 'src/filemanager.cpp')
-rw-r--r--src/filemanager.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/filemanager.cpp b/src/filemanager.cpp
index 9652087b..29e85fbc 100644
--- a/src/filemanager.cpp
+++ b/src/filemanager.cpp
@@ -1988,3 +1988,34 @@ void pj_set_searchpath(int count, const char **path) {
proj_context_set_search_paths(nullptr, count,
const_cast<const char *const *>(path));
}
+
+
+/************************************************************************/
+/* proj_context_set_ca_bundle_path() */
+/************************************************************************/
+
+/** \brief Sets CA Bundle path.
+ *
+ * Those CA Bundle path will be used by PROJ when curl and PROJ_NETWORK
+ * are enabled.
+ *
+ * If set on the default context, they will be inherited by contexts created
+ * later.
+ *
+ * The path should be encoded in UTF-8.
+ *
+ * @param ctx PROJ context, or NULL for the default context.
+ * @param path Path. May be NULL.
+ *
+ * @since PROJ 7.2
+ */
+void proj_context_set_ca_bundle_path(PJ_CONTEXT *ctx, const char *path) {
+ if (!ctx)
+ ctx = pj_get_default_ctx();
+ if (!ctx)
+ return;
+ try {
+ ctx->set_ca_bundle_path(path != nullptr ? path : "");
+ } catch (const std::exception &) {
+ }
+}