Skip to content

Commit

Permalink
Merge branch 'ancient-security-config-ssl_verify'
Browse files Browse the repository at this point in the history
  • Loading branch information
cben committed Mar 23, 2022
2 parents e05c715 + f61a4e1 commit 5086eb8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/kubeclient/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,16 @@ def context(context_name = nil)

ssl_options = {}

ssl_options[:verify_ssl] = if cluster['insecure-skip-tls-verify'] == true
OpenSSL::SSL::VERIFY_NONE
else
OpenSSL::SSL::VERIFY_PEER
end

if cluster_ca_data?(cluster)
cert_store = OpenSSL::X509::Store.new
populate_cert_store_from_cluster_ca_data(cluster, cert_store)
ssl_options[:verify_ssl] = OpenSSL::SSL::VERIFY_PEER
ssl_options[:cert_store] = cert_store
else
ssl_options[:verify_ssl] = OpenSSL::SSL::VERIFY_NONE
end

unless client_cert_data.nil?
Expand Down

0 comments on commit 5086eb8

Please sign in to comment.