From f8b322ea56bbc608b6ccba62ea5f92d563629e9b Mon Sep 17 00:00:00 2001 From: zztkm Date: Fri, 20 Sep 2024 15:10:30 +0900 Subject: [PATCH] =?UTF-8?q?ca=5Fcert=20=E3=81=8C=20android=20=E3=81=A7?= =?UTF-8?q?=E5=8B=95=E3=81=8F=E3=81=8B=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/android/app/src/main/cpp/native-lib.cpp | 6 ++++++ test/hello.cpp | 1 + test/hello.h | 1 + 3 files changed, 8 insertions(+) diff --git a/test/android/app/src/main/cpp/native-lib.cpp b/test/android/app/src/main/cpp/native-lib.cpp index 7f40fbd2..b2fcad6c 100644 --- a/test/android/app/src/main/cpp/native-lib.cpp +++ b/test/android/app/src/main/cpp/native-lib.cpp @@ -25,6 +25,11 @@ void* GetAndroidApplicationContext(void* env) { return g_ctx; } +// rootCA.pem を文字列 (std::string) として定義する +static const std::string ca_cert = R"(-----BEGIN CERTIFICATE----- +ここに CA 証明書の内容を貼り付ける +-----END CERTIFICATE-----)"; + extern "C" JNIEXPORT void JNICALL Java_jp_shiguredo_hello_MainActivity_run(JNIEnv* env, jobject /* this */, @@ -39,6 +44,7 @@ Java_jp_shiguredo_hello_MainActivity_run(JNIEnv* env, config.signaling_urls.push_back("シグナリングURL"); config.channel_id = "チャンネルID"; config.role = "sendonly"; + config.ca_cert = ca_cert; auto hello = std::make_shared(context, config); hello->Run(); RTC_LOG(LS_INFO) << "Finished io_context thread"; diff --git a/test/hello.cpp b/test/hello.cpp index 360d3124..1a5775d8 100644 --- a/test/hello.cpp +++ b/test/hello.cpp @@ -71,6 +71,7 @@ void HelloSora::Run() { config.video_bit_rate = config_.video_bit_rate; config.multistream = true; config.simulcast = config_.simulcast; + config.ca_cert = config_.ca_cert; conn_ = sora::SoraSignaling::Create(config); boost::asio::executor_work_guard diff --git a/test/hello.h b/test/hello.h index 67b99432..3a55a5c4 100644 --- a/test/hello.h +++ b/test/hello.h @@ -6,6 +6,7 @@ struct HelloSoraConfig { std::vector signaling_urls; std::string channel_id; + std::optional ca_cert; std::string role = "sendonly"; bool video = true; bool audio = true;