1313//===----------------------------------------------------------------------===//
1414
1515extension KafkaConfiguration {
16- // MARK: - SSLConfiguration
16+ // MARK: - TLSConfiguration
1717
18- /// Use to configure an SSL connection.
19- public struct SSLConfiguration : Sendable , Hashable {
18+ /// Use to configure an TLS connection.
19+ public struct TLSConfiguration : Sendable , Hashable {
2020 /// Certificate chain consisting of one leaf certificate and potenentially multiple intermediate certificates.
2121 /// The public key of the leaf certificate will be used for authentication.
2222 public struct LeafAndIntermediates : Sendable , Hashable {
@@ -73,7 +73,7 @@ extension KafkaConfiguration {
7373 }
7474 }
7575
76- /// A SSL private key.
76+ /// A TLS private key.
7777 public struct PrivateKey : Sendable , Hashable {
7878 public struct Location : Sendable , Hashable {
7979 internal enum _Location : Sendable , Hashable {
@@ -109,7 +109,7 @@ extension KafkaConfiguration {
109109 }
110110 }
111111
112- /// A SSL key store (PKCS#12).
112+ /// A TLS key store (PKCS#12).
113113 public struct KeyStore : Sendable , Hashable {
114114 /// Path to the key store.
115115 public var location : String
@@ -122,7 +122,7 @@ extension KafkaConfiguration {
122122 }
123123 }
124124
125- internal enum _SSLConfiguration : Sendable , Hashable {
125+ internal enum _TLSConfiguration : Sendable , Hashable {
126126 case keyPair(
127127 privateKey: PrivateKey ,
128128 publicKeyCertificate: LeafAndIntermediates ,
@@ -136,9 +136,9 @@ extension KafkaConfiguration {
136136 )
137137 }
138138
139- let _internal : _SSLConfiguration
139+ let _internal : _TLSConfiguration
140140
141- /// Use SSL with a given private/public key pair.
141+ /// Use TLS with a given private/public key pair.
142142 ///
143143 /// - Parameters:
144144 ///
@@ -151,8 +151,8 @@ extension KafkaConfiguration {
151151 publicKeyCertificate: LeafAndIntermediates ,
152152 caCertificate: RootCertificate = . probe,
153153 crlLocation: String ?
154- ) -> SSLConfiguration {
155- return SSLConfiguration (
154+ ) -> TLSConfiguration {
155+ return TLSConfiguration (
156156 _internal: . keyPair(
157157 privateKey: privateKey,
158158 publicKeyCertificate: publicKeyCertificate,
@@ -172,8 +172,8 @@ extension KafkaConfiguration {
172172 keyStore: KeyStore ,
173173 caCertificate: RootCertificate = . probe,
174174 crlLocation: String ?
175- ) -> SSLConfiguration {
176- return SSLConfiguration (
175+ ) -> TLSConfiguration {
176+ return TLSConfiguration (
177177 _internal: . keyStore(
178178 keyStore: keyStore,
179179 caCertificate: caCertificate,
@@ -182,7 +182,7 @@ extension KafkaConfiguration {
182182 )
183183 }
184184
185- // MARK: SSLConfiguration + Dictionary
185+ // MARK: TLSConfiguration + Dictionary
186186
187187 internal var dictionary : [ String : String ] {
188188 var resultDict : [ String : String ] = [ : ]
@@ -296,7 +296,7 @@ extension KafkaConfiguration {
296296 /// For example: `principalClaimName=azp principal=admin scopeClaimName=roles scope=role1,role2 lifeSeconds=600`.
297297 /// In addition, SASL extensions can be communicated to the broker via `extension_NAME=value`.
298298 /// For example: `principal=admin extension_traceId=123`
299- static func `default`( configuration: String ? = nil ) -> OAuthBearerMethod {
299+ public static func `default`( configuration: String ? = nil ) -> OAuthBearerMethod {
300300 return OAuthBearerMethod ( _internal: . default( configuration: configuration) )
301301 }
302302
@@ -319,7 +319,7 @@ extension KafkaConfiguration {
319319 /// - scope: Client use this to specify the scope of the access request to the broker.
320320 /// - extensions: Allow additional information to be provided to the broker.
321321 /// Comma-separated list of key=value pairs. E.g., "supportFeatureX=true,organizationId=sales-emea".
322- static func oidc(
322+ public static func oidc(
323323 configuration: String ? = nil ,
324324 clientID: String ,
325325 clientSecret: String ,
@@ -444,9 +444,9 @@ extension KafkaConfiguration {
444444 public struct SecurityProtocol : Sendable , Hashable {
445445 internal enum _SecurityProtocol : Sendable , Hashable {
446446 case plaintext
447- case ssl ( configuration: SSLConfiguration )
447+ case tls ( configuration: TLSConfiguration )
448448 case saslPlaintext( mechanism: SASLMechanism )
449- case saslSSL ( saslMechanism: SASLMechanism , sslConfiguaration : SSLConfiguration )
449+ case saslTLS ( saslMechanism: SASLMechanism , tlsConfiguaration : TLSConfiguration )
450450 }
451451
452452 private let _internal : _SecurityProtocol
@@ -456,10 +456,10 @@ extension KafkaConfiguration {
456456 _internal: . plaintext
457457 )
458458
459- /// Use the Secure Sockets Layer (SSL ) protocol.
460- public static func ssl ( configuration: SSLConfiguration ) -> SecurityProtocol {
459+ /// Use the Transport Layer Security (TLS ) protocol.
460+ public static func tls ( configuration: TLSConfiguration ) -> SecurityProtocol {
461461 return SecurityProtocol (
462- _internal: . ssl ( configuration: configuration)
462+ _internal: . tls ( configuration: configuration)
463463 )
464464 }
465465
@@ -470,13 +470,13 @@ extension KafkaConfiguration {
470470 )
471471 }
472472
473- /// Use the Simple Authentication and Security Layer (SASL) with SSL .
474- public static func saslSSL (
473+ /// Use the Simple Authentication and Security Layer (SASL) with TLS .
474+ public static func saslTLS (
475475 saslMechanism: SASLMechanism ,
476- sslConfiguaration : SSLConfiguration
476+ tlsConfiguaration : TLSConfiguration
477477 ) -> SecurityProtocol {
478478 return SecurityProtocol (
479- _internal: . saslSSL ( saslMechanism: saslMechanism, sslConfiguaration : sslConfiguaration )
479+ _internal: . saslTLS ( saslMechanism: saslMechanism, tlsConfiguaration : tlsConfiguaration )
480480 )
481481 }
482482
@@ -488,10 +488,10 @@ extension KafkaConfiguration {
488488 switch self . _internal {
489489 case . plaintext:
490490 resultDict [ " security.protocol " ] = " plaintext "
491- case . ssl ( let sslConfig ) :
491+ case . tls ( let tlsConfig ) :
492492 resultDict [ " security.protocol " ] = " ssl "
493493 // Merge result dict with SASLMechanism config values
494- resultDict. merge ( sslConfig . dictionary) { _, _ in
494+ resultDict. merge ( tlsConfig . dictionary) { _, _ in
495495 fatalError ( " Tried to override key that was already set! " )
496496 }
497497 case . saslPlaintext( let saslMechanism) :
@@ -500,13 +500,13 @@ extension KafkaConfiguration {
500500 resultDict. merge ( saslMechanism. dictionary) { _, _ in
501501 fatalError ( " Tried to override key that was already set! " )
502502 }
503- case . saslSSL ( let saslMechanism, let sslConfig ) :
503+ case . saslTLS ( let saslMechanism, let tlsConfig ) :
504504 resultDict [ " security.protocol " ] = " sasl_ssl "
505505 // Merge with other dictionaries
506506 resultDict. merge ( saslMechanism. dictionary) { _, _ in
507507 fatalError ( " Tried to override key that was already set! " )
508508 }
509- resultDict. merge ( sslConfig . dictionary) { _, _ in
509+ resultDict. merge ( tlsConfig . dictionary) { _, _ in
510510 fatalError ( " Tried to override key that was already set! " )
511511 }
512512 }
0 commit comments