简体   繁体   中英

HttpWebRequest - C# - Post with Certificate.crt + private.key

How can I send a certificate with Private.key? I am sending only the certificate and it returns a 403 Forbidden error.

Certificate + Private.key

GetAccessToken Code

PegarCertificadoServicoPeloIndividuo - Code

I had the exact same problem with this API.

To solve it, I had to ''merge'' the two files (.crt and.key).

For this, it is necessary to download a program, follow this link: https://slproweb.com/products/Win32OpenSSL.html . I downloaded the exe from the first line from that link.

After merging the.crt and.key files, you'll get a.pfx file, that's what you'll use in code to make the call to the API.

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM