私はそれが正常に動作しますが、時々私のマイWCFのWebサービスからSystem.Net.WebException:要求は中止されました:SSL/TLSのセキュリティで保護されたチャネルを作成できませんでした
using (var wc = new WebClient())
{
wc.Headers.Add("Authorization", "Key=" + ConfigurationSettings.AppSettings["apiKey"]);
var nameValues = new NameValueCollection
{
{"registration_id", objSendNotificationBE.RegistrationID},
{"collapse_key", Guid.NewGuid().ToString()},
{"data.payload", objSendNotificationBE.Message}
};
var resp = wc.UploadValues("https://android.googleapis.com/gcm/send", nameValues);
respMessage = Encoding.Default.GetString(resp);
if (respMessage == "Error=InvalidRegistration")
{
string respMessage = "";
}
}
をプッシュ通知を送信するために以下のコードを使用しています例外を取得しています
System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
at System.Net.WebClient.UploadValues(Uri address, String method, NameValueCollection data)
at System.Net.WebClient.UploadValues(String address, NameValueCollection data)
WebサービスをAzureサーバーにデプロイしました。
に答えを見ることができますか?現在読むのは難しい – dat3450
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12を追加しようとすると、 (var wc = new WebClient())を使用する前に – jitender
返信用のJitenderありがとうございましたが、この問題は定期的ではないと言われています。 – Siddhartha