Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion CommandsService/SyncDataServices/Grpc/PlatformDataClient.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using AutoMapper;
using CommandsService.Models;
using Grpc.Net.Client;
Expand All @@ -22,7 +23,15 @@ public PlatformDataClient(IConfiguration configuration, IMapper mapper)
public IEnumerable<Platform> ReturnAllPlatforms()
{
Console.WriteLine($"--> Calling GRPC Service {_configuration["GrpcPlatform"]}");
var channel = GrpcChannel.ForAddress(_configuration["GrpcPlatform"]);

var httpHandler = new HttpClientHandler();
//allow certificates that are untrusted/invalid
httpHandler.ServerCertificateCustomValidationCallback =
HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;

var channel = GrpcChannel.ForAddress(_configuration["GrpcPlatform"],
new GrpcChannelOptions { HttpHandler = httpHandler });

var client = new GrpcPlatform.GrpcPlatformClient(channel);
var request = new GetAllRequest();

Expand Down