Use external Certificate on USB with HTTP Requests

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
dian
Posts: 2
Joined: Tue 17 Nov 2020 17:14

Use external Certificate on USB with HTTP Requests

Post by dian » Tue 17 Nov 2020 17:19

Hi,
i have an certificate attached to my computer (usb dongle) which is used for authentication.
When access a website using browser, everything works as expected and receive the data.

Trying to use SecureBridge components to perform the same request using TScHttpWebRequest and provide Certificate data.
When I try to get read data in certificate, I'm able to do that using TScCryptoAPIStorage. I can read issuer, subject and raw data of certificate from USB Card.
My question is how to use this data read from USB Certificate together with HTTP Web request performed by TScHttpWebRequest component.

Thanks.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Use external Certificate on USB with HTTP Requests

Post by ViktorV » Thu 19 Nov 2020 15:42

To be able to use certificates imported into the TScCryptoAPIStorage instance with the TScHttpWebRequest component, you should set the TScHttpWebRequest.Storage property to a value equal to the name of the TScCryptoAPIStorage instance.

dian
Posts: 2
Joined: Tue 17 Nov 2020 17:14

Re: Use external Certificate on USB with HTTP Requests

Post by dian » Fri 20 Nov 2020 20:42

Thanks, i did that, but still don't have success.
Is there a something which i have to do trough the code?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Use external Certificate on USB with HTTP Requests

Post by ViktorV » Tue 24 Nov 2020 14:33

Please make sure that the CryptoAPI storage, which you assign to TScHttpWebRequest, contains the CA certificate. To get the list of certificates, use the TScCryptoAPIStorage.Certificates.GetCertificateNames method. If the storage has the CA certificate, you can use the event handler TScHttpWebRequest.SSLOptions.OnServerCertificateValidation to find out what certificate is sent by the server and why it doesn't meet your requirements.

Post Reply