fix(ssl): Update SSLManager to use dynamic schema registry paths (#23505)

This commit is contained in:
Ayush Shah 2025-09-23 18:10:18 +05:30 committed by GitHub
parent e058c5393e
commit d94b39f6f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 5 deletions

View File

@ -224,11 +224,17 @@ class SSLManager:
"ssl.key.location": getattr(self, "key_consumer_config", None),
"ssl.certificate.location": getattr(self, "cert_consumer_config", None),
}
connection.schemaRegistryConfig["ssl.ca.location"] = self.ca_file_path
connection.schemaRegistryConfig["ssl.key.location"] = self.key_file_path
connection.schemaRegistryConfig[
"ssl.certificate.location"
] = self.cert_file_path
if connection.schemaRegistrySSL:
connection.schemaRegistryConfig["ssl.ca.location"] = getattr(
self, "ca_schema_registry", None
)
connection.schemaRegistryConfig["ssl.key.location"] = getattr(
self, "key_schema_registry", None
)
connection.schemaRegistryConfig["ssl.certificate.location"] = getattr(
self, "cert_schema_registry", None
)
return connection
@setup_ssl.register(CassandraConnection)

View File

@ -125,6 +125,21 @@ class KafkaSourceSSLTest(TestCase):
kafka_source_with_ssl.service_connection.schemaRegistrySSL.root.sslCertificate.get_secret_value(),
"sslCertificateData",
)
self.assertIsNotNone(
kafka_source_with_ssl.service_connection.schemaRegistryConfig.get(
"ssl.ca.location"
),
)
self.assertIsNotNone(
kafka_source_with_ssl.service_connection.schemaRegistryConfig.get(
"ssl.key.location"
),
)
self.assertIsNotNone(
kafka_source_with_ssl.service_connection.schemaRegistryConfig.get(
"ssl.certificate.location"
),
)
class CassandraSourceSSLTest(TestCase):