mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-12 23:32:35 +00:00
Update API to support RHEL cert bundle
This commit is contained in:
2
.github/workflows/build-tebako.yml
vendored
2
.github/workflows/build-tebako.yml
vendored
@@ -2,7 +2,7 @@ name: Build Launcher Binary
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ master, test ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
14
lib/api.rb
14
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
|
||||
|
||||
Reference in New Issue
Block a user