Login using https

hg/develop
kaetemi 5 years ago committed by Jan Boon
parent 3475b3046a
commit bbee8579c7

@ -39,14 +39,15 @@ Gamma_max = 1.0;
// NETWORK //
/////////////
Application = { "ryzom_live", "./client_ryzom_r.exe", "./" };
Application = { "open", "./client_ryzom_r.exe", "./" };
BackgroundDownloader = 0;
StartupHost = "shard.ryzom.com:40916";
StartupHost = "https://open.ryzom.dev";
StartupPage = "/login/r2_login.php";
StartupVerify = 1;
ConditionsTermsURL = "http://app.ryzom.com/app_forum/index.php?page=topic/view/21885/1&post148782=en#1";
LoginSupportURL = "http://app.ryzom.com/app_forum/index.php?page=topic/view/22047/1&post149889=en#1";
NamingPolicyURL = "http://app.ryzom.com/app_forum/index.php?page=topic/view/21885/1&post148784=en#3";
ConditionsTermsURL = "http://www.gnu.org/licenses/agpl-3.0.html";
LoginSupportURL = "https://open.ryzom.dev/ams/";
NamingPolicyURL = "https://open.ryzom.dev/ams/";
// Full path and filename where cURL can find certificate bundle file
// cacert.pem file can be downloaded from https://curl.haxx.se/docs/caextract.html
@ -84,11 +85,15 @@ XMLOutGameInterfaceFiles = {
"out_v2_keys.xml",
};
TexturesInterface = "texture_interfaces_v3";
TexturesInterfaceDXTC = "texture_interfaces_dxtc";
// The ligo primitive class file
LigoPrimitiveClass = "world_editor_classes.xml";
VerboseLog = 1;
///////////
// MOUSE //
///////////
@ -604,11 +609,11 @@ ChannelIgnoreFilter =
// interval in minutes for webig notify thread to run
WebIgNotifInterval = 10;
WebIgMainDomain = "app.ryzom.com";
WebIgMainDomain = "https://open.ryzom.dev";
WebIgTrustedDomains = {
"api.ryzom.com", "app.ryzom.com"
"open.ryzom.dev"
};
PatchletUrl = "http://app.ryzom.com/app_patchlet/index.php?patch=preload";
PatchletUrl = "https://open.ryzom.dev/app_patchlet/index.php?patch=preload";
SelectedSlot = 0;

@ -317,6 +317,10 @@ int main(int argc, char **argv)
LoginCustomParameters = "&steam_auth_session_ticket=" + steamClient.getAuthSessionTicket();
#endif
#if !FINAL_VERSION
LoginCustomParameters += "&dbg=1";
#endif
// initialize patch manager and set the ryzom full path, before it's used
CPatchManager *pPM = CPatchManager::getInstance();
pPM->setRyzomFilename(Args.getProgramPath() + Args.getProgramName());

@ -330,9 +330,9 @@ CClientConfig::CClientConfig()
TexturesLoginInterface.push_back("texture_interfaces_v3_login");
DisplayAccountButtons = true;
CreateAccountURL = "https://account.ryzom.com/signup/from_client.php";
EditAccountURL = "https://account.ryzom.com/payment_profile/index.php";
ForgetPwdURL = "https://account.ryzom.com/payment_profile/lost_secure_password.php";
CreateAccountURL = "https://open.ryzom.dev/ams/";
EditAccountURL = "https://open.ryzom.dev/ams/";
ForgetPwdURL = "https://open.ryzom.dev/ams/";
Position = CVector(0.f, 0.f, 0.f); // Default Position.
Heading = CVector(0.f, 1.f, 0.f); // Default Heading.
EyesHeight = 1.5f; // Default User Eyes Height.
@ -428,15 +428,15 @@ CClientConfig::CClientConfig()
PatchletUrl.clear();
PatchVersion.clear();
WebIgMainDomain = "atys.ryzom.com";
WebIgTrustedDomains.push_back(WebIgMainDomain);
WebIgMainDomain = "https://open.ryzom.dev";
WebIgTrustedDomains.push_back("open.ryzom.dev");
WebIgNotifInterval = 10; // time in minutes
CurlMaxConnections = 5;
CurlCABundle.clear();
RingReleaseNotePath = "http://" + WebIgMainDomain + "/releasenotes_ring/index.php";
ReleaseNotePath = "http://" + WebIgMainDomain + "/releasenotes/index.php";
RingReleaseNotePath = WebIgMainDomain + "/releasenotes_ring/index.php";
ReleaseNotePath = WebIgMainDomain + "/releasenotes/index.php";
///////////////
@ -452,7 +452,7 @@ CClientConfig::CClientConfig()
SoundOn = true; // Default is with sound.
DriverSound = SoundDrvAuto;
SoundForceSoftwareBuffer = true;
SoundOutGameMusic = "Main Menu Loop.ogg";
SoundOutGameMusic = "main menu loop.ogg";
SoundSFXVolume = 1.f;
SoundGameMusicVolume = 1.f;
SoundTPFade = 500;
@ -1093,6 +1093,9 @@ void CClientConfig::setValues()
///////////
// WEBIG //
READ_STRING_FV(WebIgMainDomain);
if (ClientCfg.WebIgMainDomain.find("http://") == std::string::npos
|| ClientCfg.WebIgMainDomain.find("https://") == std::string::npos)
ClientCfg.WebIgMainDomain = "http://" + ClientCfg.WebIgMainDomain;
READ_STRINGVECTOR_FV(WebIgTrustedDomains);
READ_INT_FV(WebIgNotifInterval);
READ_INT_FV(CurlMaxConnections);

@ -63,7 +63,7 @@ bool CCurlHttpClient::authenticate(const std::string &user, const std::string &p
return true;
}
static const std::string CAFilename = "ssl_ca_cert.pem"; // this is the certificate "Thawte Server CA"
static const std::string CAFilename = "cacert.pem"; // https://curl.haxx.se/docs/caextract.html
// ***************************************************************************
bool CCurlHttpClient::verifyServer(bool verify)

@ -416,7 +416,7 @@ class CAHUIShowHide : public IActionHandler
nlwarning("%s is not a group html", window.c_str());
return;
}
pGH->setURL("http://"+ClientCfg.WebIgMainDomain+"/index.php?app="+webapp);
pGH->setURL(ClientCfg.WebIgMainDomain + "/index.php?app=" + webapp);
}
}
else

@ -267,7 +267,7 @@ public:
uint c = 0;
while (_Running)
{
string url = "https://"+domain+"/index.php?app=notif&format=lua&rnd="+randomString();
string url = domain + "/index.php?app=notif&format=lua&rnd=" + randomString();
addWebIGParams(url, true);
get(url);

@ -155,7 +155,8 @@ CLoginStateMachine LoginSM;
bool CStartupHttpClient::connectToLogin()
{
return connect(ClientCfg.ConfigFile.getVar("StartupHost").asString(0));
return connect(ClientCfg.ConfigFile.getVar("StartupHost").asString(0))
&& verifyServer(ClientCfg.ConfigFile.getVar("StartupVerify").asBool(0));
}
CStartupHttpClient HttpClient;
@ -2825,7 +2826,36 @@ string checkLogin(const string &login, const string &password, const string &cli
if(res.empty())
return "Empty answer from server (error code 62)";
if(res[0] == '0')
size_t first = res.find("\n\n");
if (first == std::string::npos)
{
first = res.find("\r\r");
if (first == std::string::npos)
{
first = res.find("\r\n\r\n");
if (first != std::string::npos)
{
res = res.substr(first + 4);
}
}
else
{
res = res.substr(first + 2);
}
}
else
{
res = res.substr(first + 2);
}
nldebug("res1: %s", res.c_str());
if (res[0] == 'H')
{
nlwarning("missing response body: %s", res.c_str());
return "missing response body (error code 64)";
}
else if(res[0] == '0')
{
// server returns an error
nlwarning("server error: %s", res.substr(2).c_str());
@ -2878,7 +2908,36 @@ string checkLogin(const string &login, const string &password, const string &cli
if(res.empty())
return "Empty answer from server (error code 4)";
if(res[0] == '0')
size_t first = res.find("\n\n");
if (first == std::string::npos)
{
first = res.find("\r\r");
if (first == std::string::npos)
{
first = res.find("\r\n\r\n");
if (first != std::string::npos)
{
res = res.substr(first + 4);
}
}
else
{
res = res.substr(first + 2);
}
}
else
{
res = res.substr(first + 2);
}
nldebug("res2: %s", res.c_str());
if (res[0] == 'H')
{
nlwarning("missing response body: %s", res.c_str());
return "missing response body (error code 65)";
}
else if(res[0] == '0')
{
// server returns an error
nlwarning("server error: %s", res.substr(2).c_str());
@ -2960,7 +3019,36 @@ string checkLogin(const string &login, const string &password, const string &cli
if(res.empty())
return "Empty answer from server (error code 4)";
if(res[0] == '0')
size_t first = res.find("\n\n");
if (first == std::string::npos)
{
first = res.find("\r\r");
if (first == std::string::npos)
{
first = res.find("\r\n\r\n");
if (first != std::string::npos)
{
res = res.substr(first + 4);
}
}
else
{
res = res.substr(first + 2);
}
}
else
{
res = res.substr(first + 2);
}
nldebug("res2: %s", res.c_str());
if (res[0] == 'H')
{
nlwarning("missing response body: %s", res.c_str());
return "missing response body (error code 66)";
}
else if(res[0] == '0')
{
// server returns an error
nlwarning("server error: %s", res.substr(2).c_str());
@ -3065,7 +3153,36 @@ string selectShard(uint32 shardId, string &cookie, string &addr)
if(res.empty())
return "Empty result (error code 13)";
if(res[0] == '0')
size_t first = res.find("\n\n");
if (first == std::string::npos)
{
first = res.find("\r\r");
if (first == std::string::npos)
{
first = res.find("\r\n\r\n");
if (first != std::string::npos)
{
res = res.substr(first + 4);
}
}
else
{
res = res.substr(first + 2);
}
}
else
{
res = res.substr(first + 2);
}
nldebug("res2: %s", res.c_str());
if (res[0] == 'H')
{
nlwarning("missing response body: %s", res.c_str());
return "missing response body (error code 66)";
}
else if(res[0] == '0')
{
// server returns an error
nlwarning("server error: %s", res.substr(2).c_str());

@ -19,7 +19,7 @@
#define CL_LOGIN_H
#include "nel/misc/types_nl.h"
#include "game_share/http_client.h"
#include "http_client_curl.h"
#include <string>
#include <vector>
@ -74,7 +74,7 @@ extern sint32 ShardSelected;
/*
* HTTP client preconfigured to connect to the startup login host
*/
class CStartupHttpClient : public CHttpClient
class CStartupHttpClient : public CCurlHttpClient
{
public:

@ -3292,7 +3292,7 @@ private:
if(i != digitMaxEnd)
{
ucstring web_app = contentStr.substr(digitStart, i-digitStart);
contentStr = ucstring("http://"+ClientCfg.WebIgMainDomain+"/")+web_app+ucstring("/index.php?")+contentStr.substr(i+1);
contentStr = ucstring(ClientCfg.WebIgMainDomain + "/") + web_app + ucstring("/index.php?") + contentStr.substr((size_t)i + 1);
}
else
{

Loading…
Cancel
Save