Jump to content

HTTPS/Client-authenticated: Difference between revisions

add C#
m (removed omit for REXX. -- ~~~~)
(add C#)
Line 5:
This task is in general useful for use with [[Creating a SOAP Client|webservice client]]s as it offers a high level of assurance that the client is an acceptable counterparty for the server. For example, [http://aws.amazon.com/ Amazon Web Services] uses this style of authentication.
 
=={{header|C sharp|C#}}==
{{works with|C sharp|3.0}}
 
<lang csharp>
using System;
using System.Net;
 
class Program
{
class MyWebClient : WebClient
{
protected override WebRequest GetWebRequest(Uri address)
{
HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(address);
request.ClientCertificates.Add(new X509Certificate());
return request;
}
}
static void Main(string[] args)
{
var client = new MyWebClient();
 
var data = client.DownloadString("https://example.com");
 
Console.WriteLine(data);
}
}
</lang>
=={{header|Lasso}}==
<lang Lasso>local(sslcert = file('myCert.pem'))
256

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.