Skip to content

Commit

Permalink
Let the insecureSkipTLSVerify property work
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinLau7 committed Sep 18, 2023
1 parent adca31d commit 6748b8d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Sources/SwiftkubeClient/Client/KubernetesClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,13 @@ public class KubernetesClient {
self.logger = logger ?? SwiftkubeClient.loggingDisabled

var tlsConfiguration = TLSConfiguration.makeClientConfiguration()
tlsConfiguration.minimumTLSVersion = .tlsv12
tlsConfiguration.trustRoots = config.trustRoots

if config.insecureSkipTLSVerify {
tlsConfiguration.certificateVerification = .none
} else {
tlsConfiguration.minimumTLSVersion = .tlsv12
tlsConfiguration.trustRoots = config.trustRoots
}

if case let KubernetesClientAuthentication.x509(clientCertificate, clientKey) = config.authentication {
tlsConfiguration.certificateChain = [.certificate(clientCertificate)]
Expand Down

0 comments on commit 6748b8d

Please sign in to comment.