How do I specify a Certificate File for Xojo.net.HTTPSocket

I’m need to call a Web Service on a secure socket and the web service requires me to attach my certificate file. The web service is using HTTP1.1 so I’m trying to use the Xojo.net.HTTPSocket class but there’s no apparent way to specify the certificate?

On the old HTTPSecureSocket, you could attach the certificate file by setting the HTTPSecureSocket.CertificateFile property. How do I achieve the same result with Xojo.net.HTTPSocket?

Am I missing something?

I thing you need this one
ValidateCertificates As Boolean = True

When set to True, the socket verifies the supplied certificate for authenticity.

Thanks Loannis,

The documentation for ValidateCertificates say “the socket verifies the supplied certificate” but how do I supply the certificate?

I’m actually managing to connect successfully using the old HTTPSecureSocket now but I’m clearing not understanding something about the Xojo.net.HTTPSocket.

ValidateCertificates is all you need. You don’t need to specify the certificate, the new socket uses the system’s trusted roots to verify identity.

I think @Jim Brock is asking about using a client certificate rather than validating the server’s certificate.

Sorry for the delay in responding, I’ve been away for a few days.

I am confused about the certificates. I am calling a UK, NHS web service on their private network. They have supplied me with a certificate which includes a private key and I need to supply this when I make the call to their service. So is this a client certificate?

When I use the old HTTPSecureSocket, I am able to specify the certificate file and call the service and get a successful response but I can’t repeat this using the Xojo.net.HTTPSocket.

I’m not sure if that clarifies things or not.

[quote=396052:@Jim Brock]Sorry for the delay in responding, I’ve been away for a few days.

I am confused about the certificates. I am calling a UK, NHS web service on their private network. They have supplied me with a certificate which includes a private key and I need to supply this when I make the call to their service. So is this a client certificate?

When I use the old HTTPSecureSocket, I am able to specify the certificate file and call the service and get a successful response but I can’t repeat this using the Xojo.net.HTTPSocket.

I’m not sure if that clarifies things or not.[/quote]
http1.1 changes focus most on proxy handle and some changes on headers…
The Xojo.net.HTTPSocket is for 1.1 http if the HTTPSecureSocket working for you is better to use it until the Xojo.net.HTTPSocket have better information…

[quote=396052:@Jim Brock]Sorry for the delay in responding, I’ve been away for a few days.

I am confused about the certificates. I am calling a UK, NHS web service on their private network. They have supplied me with a certificate which includes a private key and I need to supply this when I make the call to their service. So is this a client certificate?

When I use the old HTTPSecureSocket, I am able to specify the certificate file and call the service and get a successful response but I can’t repeat this using the Xojo.net.HTTPSocket.

I’m not sure if that clarifies things or not.[/quote]
Can you provide us a link to the docs?