2323using System . Threading . Tasks ;
2424using System . Linq ;
2525using System ;
26+ using System . Net ;
2627using System . Threading ;
2728using System . Security . Cryptography . X509Certificates ;
2829using Confluent . Kafka ;
@@ -166,8 +167,12 @@ private static SubjectNameStrategyDelegate GetValueSubjectNameStrategy(
166167 /// <param name="authenticationHeaderValueProvider">
167168 /// The authentication header value provider
168169 /// </param>
170+ /// <param name="proxy">
171+ /// The proxy server to use for connections
172+ /// </param>
169173 public CachedSchemaRegistryClient ( IEnumerable < KeyValuePair < string , string > > config ,
170- IAuthenticationHeaderValueProvider authenticationHeaderValueProvider )
174+ IAuthenticationHeaderValueProvider authenticationHeaderValueProvider ,
175+ IWebProxy proxy = null )
171176 {
172177 if ( config == null )
173178 {
@@ -352,13 +357,8 @@ public CachedSchemaRegistryClient(IEnumerable<KeyValuePair<string, string>> conf
352357 }
353358
354359 var sslCaLocation = config . FirstOrDefault ( prop => prop . Key . ToLower ( ) == SchemaRegistryConfig . PropertyNames . SslCaLocation ) . Value ;
355- if ( string . IsNullOrEmpty ( sslCaLocation ) )
356- {
357- this . restService = new RestService ( schemaRegistryUris , timeoutMs , authenticationHeaderValueProvider , SetSslConfig ( config ) , sslVerify ) ;
358- } else
359- {
360- this . restService = new RestService ( schemaRegistryUris , timeoutMs , authenticationHeaderValueProvider , SetSslConfig ( config ) , sslVerify , new X509Certificate2 ( sslCaLocation ) ) ;
361- }
360+ var sslCaCertificate = string . IsNullOrEmpty ( sslCaLocation ) ? null : new X509Certificate2 ( sslCaLocation ) ;
361+ this . restService = new RestService ( schemaRegistryUris , timeoutMs , authenticationHeaderValueProvider , SetSslConfig ( config ) , sslVerify , sslCaCertificate , proxy ) ;
362362 }
363363
364364 /// <summary>
@@ -372,6 +372,20 @@ public CachedSchemaRegistryClient(IEnumerable<KeyValuePair<string, string>> conf
372372 {
373373 }
374374
375+ /// <summary>
376+ /// Initialize a new instance of the SchemaRegistryClient class.
377+ /// </summary>
378+ /// <param name="config">
379+ /// Configuration properties.
380+ /// </param>
381+ /// <param name="proxy">
382+ /// The proxy server to use for connections
383+ /// </param>
384+ public CachedSchemaRegistryClient ( IEnumerable < KeyValuePair < string , string > > config , IWebProxy proxy )
385+ : this ( config , null , proxy )
386+ {
387+
388+ }
375389
376390 /// <remarks>
377391 /// This is to make sure memory doesn't explode in the case of incorrect usage.
0 commit comments