Unsolved

This post is more than 5 years old

18 Posts

1829

September 21st, 2011 03:00

Unable to connect to server error

Hi ,

I couldn't connect to "cloudonestorage.peer1.com" server,

Previously i can connect to the server and upload my files into cloud server using EsuApiLib assembly,

But suddenly I am getting the error message "Unable to connect to remote server".

I tried to upload flies using AtomosFox plugin,there also i was getting same error.

Is ther any problem in server? why can't i connect to server? Is there problem in our side?

Please let me know the solution for this.

Regards,

Karthik.

222 Posts

September 21st, 2011 06:00

Karthik,

You'll need to inquire with your support contacts at Peer1.  They manage their storage service and can perhaps provide insight into your issue.

Raj

18 Posts

September 26th, 2011 00:00

Hi,

We have changed the host name to "http://atl.cloudonestorage.peer1.com".

We can upload the files using  AtmosFox explorer by changing the preference end URL to http://atl.cloudonestorage.peer1.com.

But we have changed the host name to "http://atl.cloudonestorage.peer1.com",

const string host = "atl.cloudonestorage.peer1.com";

const int port = 443;

const string userName = id;

const string secret = key;

EsuRestApi cloudRest = new EsuRestApi(host, port, userName, secret);

we are getting the exception like below,

exception.png

Can anyone give me a solution?

Regards,

Karthik.

281 Posts

September 26th, 2011 06:00

Hi Karthik,

Your url is using HTTP, not HTTPS.  In this case, your port should be 80, not 443.

If you require HTTPS, try setting:

host: cloudonestorage.peer1.com

port: 443

The Exception you see above is because the SSL certificate was issued to cloudonestorage.peer1.com, not atl.cloudonestorage.peer1.com.

18 Posts

September 26th, 2011 22:00

Hi

Thanks for the solution. But now i am facing one more problem,

that is  "The request timestamp was outside the valid time window."

Previously i solved this solution by added below code in EsuRestApi.cs,

To get dateheader value give a web request to "http://cloudonestorage.peer1.com" and get server date response.

   HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://cloudonestorage.peer1.com");

   WebResponse webResponse = webRequest.GetResponse();

   DateTime dateTime = DateTime.Parse(webResponse.Headers["Date"]);               

    // Add date

    string dateHeader = dateTime.ToUniversalTime().ToString("r");

    log.TraceEvent(TraceEventType.Verbose, 0,  "Date: " + dateHeader );

    headers.Add( "Date", dateHeader );

Now i am getting different respose time from the server when i used this code,i have also tried to change the server name by  "http:/atl./cloudonestorage.peer1.com", but it also gives the different time.

Also the i am getting the same response date time header when i try to run the sample again and again.

like when i run the sample first time i am getting the dateheader 7:04 am and changed to unversel time getting 5.04 am,

so added addhours(2) and the add to "headers.Add( "Date", dateHeader );" and getting the timestamp error,

and also tried the same some times later, that time also i am getting the same dateheader 7:04 am

Please let me know if i did anything wrong?

281 Posts

September 27th, 2011 06:00

Try using http://cloudonestorage.peer1.com/rest/ to make sure you're accessing the Atmos REST API and not getting redirected to their sign-up server.

I would also check the value of the raw date header and use HttpResponseHeaders.Date instead of the String "Date".  Here's my test program:

Console.Write("Enter URL: ");
string url = Console.ReadLine();

WebRequest request = WebRequest.Create(url);
WebResponse response = request.GetResponse();

string dateHeader = response.Headers[HttpResponseHeader.Date];
DateTime dateTime = DateTime.Parse(dateHeader);

Console.WriteLine("Server Time is: " + dateHeader);
Console.WriteLine("Parsed time is: " + dateTime.ToUniversalTime().ToString("r"));
Console.ReadLine();

0 events found

No Events found!

Top