From 4d3163740a062053699c9f3dffde4f12c2bde119 Mon Sep 17 00:00:00 2001 From: The Unnamed Engineer Date: Tue, 10 Jun 2025 12:37:33 -0400 Subject: [PATCH] Update API to support RHEL cert bundle --- .github/workflows/build-tebako.yml | 2 +- lib/api.rb | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-tebako.yml b/.github/workflows/build-tebako.yml index 57b1686..61c23b0 100644 --- a/.github/workflows/build-tebako.yml +++ b/.github/workflows/build-tebako.yml @@ -2,7 +2,7 @@ name: Build Launcher Binary on: push: - branches: [ master ] + branches: [ master, test ] workflow_dispatch: jobs: diff --git a/lib/api.rb b/lib/api.rb index 763323b..816f439 100644 --- a/lib/api.rb +++ b/lib/api.rb @@ -1,5 +1,19 @@ class W3DHub class Api + + # Detect CA bundle path for Excon + def self.ca_bundle_path + redhat_path = '/etc/pki/tls/certs/ca-bundle.crt' + debian_path = '/etc/ssl/certs/ca-certificates.crt' + [redhat_path, debian_path].find { |path| File.exist?(path) } + end + + # Set Excon default CA file if found + ca_file = ca_bundle_path + if ca_file + Excon.defaults[:ssl_ca_file] = ca_file + end + LOG_TAG = "W3DHub::Api".freeze API_TIMEOUT = 30 # seconds