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;