File tree Expand file tree Collapse file tree
src/Etcd.Microsoft.Extensions.Configuration/Client Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System ;
2+ using System . Diagnostics ;
23using dotnet_etcd ;
34using dotnet_etcd . interfaces ;
45using Etcd . Microsoft . Extensions . Configuration . Settings ;
6+ using Grpc . Core ;
57
68namespace Etcd . Microsoft . Extensions . Configuration . Client ;
79
@@ -38,7 +40,13 @@ public IEtcdClient Create()
3840 {
3941 if ( string . IsNullOrEmpty ( Settings . ConnectionString ) )
4042 throw new EtcdConfigurationException ( "Connection string is missing, should be passed in AddEtcd parameters or set in environment variables." ) ;
43+ var client = new EtcdClient ( Settings . ConnectionString ) ;
4144
42- return new EtcdClient ( Settings . ConnectionString , ssl : Settings . ConnectionString ! . StartsWith ( "https" ) ) ;
45+ return new EtcdClient ( Settings . ConnectionString , configureChannelOptions : ( options =>
46+ {
47+ options . Credentials = Settings . ConnectionString ! . StartsWith ( "https" )
48+ ? ChannelCredentials . SecureSsl
49+ : ChannelCredentials . Insecure ;
50+ } ) ) ;
4351 }
4452}
You can’t perform that action at this time.
0 commit comments