Skip to content

Commit

Permalink
ca_cert が android で動くかテスト
Browse files Browse the repository at this point in the history
  • Loading branch information
zztkm committed Sep 20, 2024
1 parent 3fc60c4 commit f8b322e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/android/app/src/main/cpp/native-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */,
Expand All @@ -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<HelloSora>(context, config);
hello->Run();
RTC_LOG(LS_INFO) << "Finished io_context thread";
Expand Down
1 change: 1 addition & 0 deletions test/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<boost::asio::io_context::executor_type>
Expand Down
1 change: 1 addition & 0 deletions test/hello.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
struct HelloSoraConfig {
std::vector<std::string> signaling_urls;
std::string channel_id;
std::optional<std::string> ca_cert;
std::string role = "sendonly";
bool video = true;
bool audio = true;
Expand Down

0 comments on commit f8b322e

Please sign in to comment.