mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-15 08:42:34 +00:00
Patch IRC config to detect RHEL cert bundle
This commit is contained in:
@@ -10,6 +10,15 @@ class W3DHub
|
||||
TAG = "IRCClient"
|
||||
|
||||
class SSL
|
||||
# Detect system CA bundle path for SSL verification
|
||||
def self.ca_bundle_path
|
||||
[
|
||||
'/etc/ssl/certs/ca-certificates.crt', # Debian/Ubuntu
|
||||
'/etc/pki/tls/certs/ca-bundle.crt', # RHEL/Fedora/CentOS
|
||||
'/etc/ssl/ca-bundle.pem' # Some other distros
|
||||
].find { |path| File.exist?(path) }
|
||||
end
|
||||
|
||||
def self.default_context
|
||||
verify_peer_and_hostname
|
||||
end
|
||||
@@ -23,7 +32,13 @@ class W3DHub
|
||||
def self.verify_peer
|
||||
no_verify.tap do |context|
|
||||
context.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
||||
context.cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
|
||||
context.cert_store = OpenSSL::X509::Store.new
|
||||
ca_file = ca_bundle_path
|
||||
if ca_file
|
||||
context.cert_store.add_file(ca_file)
|
||||
else
|
||||
context.cert_store.set_default_paths
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user