Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » HttpRequest cannot get the server [SOLVED]
HttpRequest cannot get the server [SOLVED] [message #53089] Mon, 24 February 2020 23:07 Go to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I spent all the day trying to figure out this problem but with no result. Perhaps it is not U++ related.
So far with the following code

    String url = "some_valid_url";
    HttpRequest r(url);
    r.KeepAlive(true);
	String content = r.Execute();
	if(r.IsFailure())
	{ Exclamation("error");
	  r.Close();
	  return;
	}
    r.Close();
    Exclamation(content);


I was able to get the content of the site at the given url. Now if I use

url = "http://www.vegaresult.com/vr/index.php";

or

url = "https://www.vegaresult.com/vr/index.php";

HttpRequest give an error (IsFailure()=true)
However if I paste the url in the browser I can see the site.
That site has a HTTPS protocol and configured as VirtualHost in Apache.
I wonder why HttpRequest is not able to see the site. Could it depend by the server that is in someway badly configured?

Thanks a lot for any answer!
Luigi

[Updated on: Tue, 25 February 2020 09:05]

Report message to a moderator

Re: HttpRequest cannot get the server [message #53090 is a reply to message #53089] Mon, 24 February 2020 23:37 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello Luigi,

I've tested the snippet you've provided above with

https://www.vegaresult.com/vr/index.php


And it works fine if I add Core/SSL package to the app, and #include <Core/SSL/SSL.h> in the source code.

Have you added these to your app?

Best regards,
Oblivion


Re: HttpRequest cannot get the server [message #53092 is a reply to message #53090] Tue, 25 February 2020 09:04 Go to previous message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
Oblivion wrote on Mon, 24 February 2020 23:37


And it works fine if I add Core/SSL package to the app, and #include <Core/SSL/SSL.h> in the source code.

Have you added these to your app?


Hello Oblivion,

Of course not! Rolling Eyes

I have added them and now everything works OK.
Thank you very much! I have lost many hours with this problem checking the server side and trying useless thing.
Thanks again,

Luigi
Previous Topic: File upload to https [SOLVED]
Next Topic: Why SshExec close the connexion ?
Goto Forum:
  


Current Time: Fri Mar 29 05:47:56 CET 2024

Total time taken to generate the page: 0.01565 seconds