当我调用这个 API 时,我会得到invalid certificate
.
如何解决这个问题?
string res = string.Empty;
string str = context.Request["params"].ToString();
string json = new JavaScriptSerializer().Serialize(new
{
login = "aaa",
password = "ssss",
command = "ssl_decoder",
ssl_certificate = str
});
var httpWebRequest = (HttpWebRequest)WebRequest
.Create("https://api.sslguru.com?params="+str.Normalize());
httpWebRequest.ContentType = "text/json";
httpWebRequest.Method = "POST";
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
res = streamReader.ReadToEnd();
}
}
return res;