# Register Alert Endpoint not working

**URL:** <https://discussions.flightaware.com/t/register-alert-endpoint-not-working/36918>\
**Category:** AeroAPI\
**Created:** [June 27, 2018, 10:30am UTC](https://discussions.flightaware.com/t/register-alert-endpoint-not-working/36918 "2018-06-27T10:30:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![365response](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/365response/32/16199_2.png) [@365response](https://discussions.flightaware.com/u/365response)\
**Post date:** [June 27, 2018, 10:30am UTC](https://discussions.flightaware.com/t/register-alert-endpoint-not-working/36918/1 "2018-06-27T10:30:21Z")

</div>

I’m trying to register my alert endpoint via FlightXML2 service but I keep getting the following error message:

**Error Response**  
“{System.IO.IOException: Authentication failed because the remote party has closed the transport stream.  
at System.Net.Security.SslState.StartReadFrame(Byte buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)  
at System.Net.Security.SslState.StartReceiveBlob(Byte buffer, AsyncProtocolRequest asyncRequest)  
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)  
at System.Net.Security.SslState.StartSendBlob(Byte incoming, Int32 count, AsyncProtocolRequest asyncRequest)  
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte buffer, AsyncProtocolRequest asyncRequest)  
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)  
at System.Net.TlsStream.CallProcessAuthentication(Object state)  
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)  
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)  
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)  
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)  
at System.Net.TlsStream.Write(Byte buffer, Int32 offset, Int32 size)  
at System.Net.PooledStream.Write(Byte buffer, Int32 offset, Int32 size)  
at System.Net.ConnectStream.WriteHeaders(Boolean async)}. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.”

**Here is a copy of my code which I’m using to send the request:**

```
            var client = new FlightXML2SoapClient();
            client.ClientCredentials.UserName.UserName = ConfigurationManager.AppSettings["FlightAwareUsername"];
            client.ClientCredentials.UserName.Password = ConfigurationManager.AppSettings["FlightXML2APIKey"];
            var apiDomain = ConfigurationManager.AppSettings["apiDomain"];

            var response = client.RegisterAlertEndpoint($"{apiDomain}/FlightAware/Alert", "json/post");

            rtnVal = response == 1;

```

---

<div class="post-metadata">

**Author:** ![dogrock](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/dogrock/32/118974_2.png) [@dogrock](https://discussions.flightaware.com/u/dogrock)\
**Post date:** [June 29, 2018, 10:16pm UTC](https://discussions.flightaware.com/t/register-alert-endpoint-not-working/36918/2 "2018-06-29T22:16:56Z")

</div>

Can you please confirm that when making the request that you are using TLS version 1.2? This can usually be forced by setting

`System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;`

Before instantiating the client object.
