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

Discussion in 'ASP .Net Web Services' started by Joel Barsotti, Apr 19, 2007.

  1. I'm working on shipping rate calculator going back and forth via XML. The
    thing I'm confused about is that the code works, but after a few hours and I
    don't know how many requests, I start getting the error "The underlying
    connection was closed: Could not establish trust relationship for the
    SSL/TLS secure channel." I can't imagine UPS's certificate is bad.

    Here's my code, let me know if you see any glaring issues.

    HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(upsRateUri);
    myReq.Headers.Clear();
    myReq.Method = "POST";
    myReq.ContentType = "application/x-www-form-urlencoded";
    myReq.ContentLength = xmlString.Length;
    StreamWriter sendingData = new StreamWriter(myReq.GetRequestStream());
    sendingData.Write(xmlString);
    sendingData.Close();
    WebResponse myResponse = myReq.GetResponse();
    Joel Barsotti, Apr 19, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. C.W.
    Replies:
    1
    Views:
    5,932
  2. Jim Butler
    Replies:
    7
    Views:
    7,383
    Steven Cheng[MSFT]
    Jul 12, 2006
  3. Joel Barsotti
    Replies:
    4
    Views:
    6,519
    Joel Barsotti
    Apr 20, 2007
  4. Ghislain Tanguay
    Replies:
    3
    Views:
    199
    suresh g
    Sep 3, 2004
  5. C.W.
    Replies:
    1
    Views:
    163
Loading...

Share This Page