Skip to content

Commit fc07483

Browse files
committed
refactor: Create fresh baseclient for secure
1 parent 2c3d97b commit fc07483

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/IBM.WatsonDeveloperCloud/Http/WatsonHttpClient.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public IClient WithAuthentication(string userName, string password)
8383

8484
public IClient WithAuthentication(string apikey)
8585
{
86-
if(!string.IsNullOrEmpty(apikey))
86+
if (!string.IsNullOrEmpty(apikey))
8787
{
8888
this.BaseClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apikey);
8989
}
@@ -174,9 +174,7 @@ public void SendAsInsecure(bool insecure)
174174
}
175175
else
176176
{
177-
var httpClientHandler = new HttpClientHandler();
178-
httpClientHandler.ServerCertificateCustomValidationCallback = null;
179-
this.BaseClient = new HttpClient(httpClientHandler);
177+
this.BaseClient = new HttpClient();
180178
}
181179
}
182180
}

0 commit comments

Comments
 (0)