Showing results for 
Search instead for 
Did you mean: 

ARB Subscription Request SSL Connection Error



I'm using ASP.NET C# to connect to the live ARB server:


When I make a Subscription Request from our live server, I get this error:


"The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."


Now, the code works perfectly to either the live or test server from our development environment, but not from our production environment.  Authorize.NET live support (who was superbly unhelpful) told me it was a problem with OUR SSL certificate, which I don't buy.  Nothing else we do securely, even connections to non-ARB Authorize.NET API requests) has any issue at all.


The basic C# code for sending the requests is:


private XmlDocument SendRequest()       


            Uri myUri = new Uri(this._postUrl);
            HttpWebRequest req = WebRequest.Create(myUri) as HttpWebRequest;           

            req.KeepAlive = false;

            req.Method = "POST"; 

            req.ContentType = "text/xml";

            StreamWriter sw = new StreamWriter(req.GetRequestStream());            sw.WriteLine(this._doc.InnerXml);                           sw.Close();

            // Send the data

            WebResponse rsp = req.GetResponse();

            // Read the response

            StreamReader sr = new StreamReader(rsp.GetResponseStream());

            string content = sr.ReadToEnd();


            XmlDocument response = new XmlDocument();



            // Close the response and free resources





            return response;



The exception is throw at WebResponse rsp = req.GetResponse();


Has anyone else seen this and have a solution for me?  Again, this doesn't happen when I call the regular Authorize.NET API at with the same credentials and the ARB system works perfectly in our development environment against both TEST and LIVE servers.


Thanks in advance!



Bill Rowell


What do you get when you put in the browser URL address on your production server/environment?


I get:


This XML file does not appear to have any style information associated with it. The document tree is shown below.      <ErrorResponse><messages><resultCode>Error</resultCode><message><code>E00002</code><text>The content-type specified is not supported.</text></message></messages></ErrorResponse>


The request works and the site/page is secure.



We just updated our SSL certificate for this site/server the other day.  Our other secure pages are working fine though, so that's why I don't think our SSL certificate is the issue.


Could I be wrong?

Is that from Firefox?


This XML file does not appear to have any style information associated with it. The document tree is shown below.      <ErrorResponse><messages><resultCode>Error</result

Code><message><code>E00002</code><text>The content-type specified is not supported.</text></message></messages></ErrorResponse>

What about in IE?


I don't think is your SSL. It something about the production SSL certificate your production server didn't like, or it caching an old/invalid certificate.

There is workaround

I'm almost positive that this is a problem with Authorize.NET's certificate I think and the way the .NET framework handles SSL certificates.  I found a work around here:


I used this line of code to ignore the error:


ServicePointManager.ServerCertificateValidationCallback +=

                 delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };


I think its because the name on the certificate doesn't exactly match the server I'm connecting to.  At least that's the best information I can find regarding this issue.


I have it working for now, but I'm not 100% thrilled with the solution.