现在想做这么一个程序,共有一个客户端(A),一个SERVER端(B),还有N个域名(有CA证书的)
A判断N个域名中哪个可用,然手请求B端,POST一个域名过来,然后由B端请求这个域名(https的)
然后通过之后,B端处理数据并返回给A端,下面是代码
private void GetHttps()
{
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(CheckValidationResult);
HttpWebRequest req = (HttpWebRequest)WebRequest.CreateDefault(new Uri("https://****/Default.html"));
req.Method = "GET";
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
Stream test = res.GetResponseStream();
//在下面想做B端向A端回写数据的过程,这个过程怎么通过刚才的HTTPS访问加密呢?
//第一次做HTTPS的理解的有点不太准确,请大家指导下
}
public bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
return true;
}