Hi! I'm trying to use HttpTwo with APNS (development server). Any first request (POST, Connect, Ping) is processed successfully, but, after that, any other request except Disconnect fails with error of broken connection from the remote party.
var store = new X509Store("MY", StoreLocation.CurrentUser);
Http2Client request2 = null;
try
{
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
var myCert =
store.Certificates.Find(X509FindType.FindBySubjectName, "Apple Development IOS Push Services", false)
.OfType<X509Certificate2>()
.FirstOrDefault();
//var uri = new Uri("https://api.development.push.apple.com");
var path =
new Uri(
"https://api.development.push.apple.com/3/device/somedeviceId");
request2 = new Http2Client(path, myCert != null ? new X509Certificate2Collection(myCert) : null);
store.Close();
var stream1 = new MemoryStream();
var notif = new Notification {Aps = new Aps {Alert = "Hello", Sound = "default"}};
var ser = new DataContractJsonSerializer(typeof (Notification));
ser.WriteObject(stream1, notif);
stream1.Position = 0;
var response = await request2.Send(path, HttpMethod.Post, null, stream1);
Every new request in the same process (even made with new Http2Client instance) is refused by server.
What do I do wrong?
Hi! I'm trying to use HttpTwo with APNS (development server). Any first request (POST, Connect, Ping) is processed successfully, but, after that, any other request except Disconnect fails with error of broken connection from the remote party.
Every new request in the same process (even made with new Http2Client instance) is refused by server.
What do I do wrong?