Também do <@!781928420757864468> :
// modelo funcional
public void GerarTokenGN(string client_id, string client_secret)
{
// força o uso do protocolo TLS, caso o protocolo padrão seja SSL ou outro protocolo
//ServicePointManager.Expect100Continue = true;
//ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3;
X509Certificate2 uidCert = new X509Certificate2("NOME_DO_CERTIFICADO.p12", "");
var client = new RestSharp.RestClient("https://api-pix-h.gerencianet.com.br/oauth/token");
client.ClientCertificates = new X509CertificateCollection() { uidCert };
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic " + System.Convert.ToBase64String(Encoding.ASCII.GetBytes(string.Format("{0}:{1}", client_id, client_secret))));
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\"grant_type\":\"client_credentials\",\"client_id\":\"" + client_id + "\",\"client_secret\":\"" + client_secret + "\"}", ParameterType.RequestBody);
IRestResponse restResponse = client.Execute(request);
string response = restResponse.Content;
Console.WriteLine(response);
}