clickatell からの応答がないため、いろいろ調べてみたところ、このスレッドが見つかりました...
「基になる接続が閉じられました: 送信時に予期しないエラーが発生しました。」SSL証明書あり
私は.net 4を使用しているので、このコード行をclickatellから取得したRest Classに追加しようとしました...
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
このコードを追加すると、システムが再び機能するようになりました..
したがって、.net4 と REST API を使用している場合は、次のコードが必要です。
class Rest
{
//This takes the API Key and JSON array of data and posts it to the Message URL to send the SMS's
public static string Post(string Token, string json)
{
var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://platform.clickatell.com/messages");
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";
httpWebRequest.Accept = "application/json";
httpWebRequest.PreAuthenticate = true;
httpWebRequest.Headers.Add("Authorization", Token);
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
return result;
}
}
}
これが他の誰かに役立つことを願っています....