summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2011-03-23 11:36:00 -0700
committerLeyla Farazha <leyla@lindenlab.com>2011-03-23 11:36:00 -0700
commit3ad81bb4a642d25018b773d2ef005380664d8170 (patch)
treeb1bbf66c0babf6c541858b34d4a7f66ad19308b0 /indra/newview/llviewermedia.cpp
parenta2c659378b8b7c8a4128c61b5cde91eccc9db4e6 (diff)
parent62a958d341532287519a23a362ff7aebd501e1c9 (diff)
Merge
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp69
1 files changed, 58 insertions, 11 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index a8d5c9776c..6d3316cf6a 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -59,6 +59,8 @@
#include "lluuid.h"
#include "llkeyboard.h"
#include "llmutelist.h"
+#include "llpanelprofile.h"
+#include "llappviewer.h"
//#include "llfirstuse.h"
#include "llwindow.h"
@@ -292,6 +294,43 @@ public:
};
+class LLViewerMediaWebProfileResponder : public LLHTTPClient::Responder
+{
+LOG_CLASS(LLViewerMediaWebProfileResponder);
+public:
+ LLViewerMediaWebProfileResponder(std::string host)
+ {
+ mHost = host;
+ }
+
+ ~LLViewerMediaWebProfileResponder()
+ {
+ }
+
+ /* virtual */ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+ {
+ LL_WARNS("MediaAuth") << "status = " << status << ", reason = " << reason << LL_ENDL;
+ LL_WARNS("MediaAuth") << content << LL_ENDL;
+
+ std::string cookie = content["set-cookie"].asString();
+
+ LLViewerMedia::getCookieStore()->setCookiesFromHost(cookie, mHost);
+ }
+
+ void completedRaw(
+ U32 status,
+ const std::string& reason,
+ const LLChannelDescriptors& channels,
+ const LLIOPipe::buffer_ptr_t& buffer)
+ {
+ // This is just here to disable the default behavior (attempting to parse the response as llsd).
+ // We don't care about the content of the response, only the set-cookie header.
+ }
+
+ std::string mHost;
+};
+
+
LLPluginCookieStore *LLViewerMedia::sCookieStore = NULL;
LLURL LLViewerMedia::sOpenIDURL;
std::string LLViewerMedia::sOpenIDCookie;
@@ -1351,6 +1390,19 @@ void LLViewerMedia::setOpenIDCookie()
// *HACK: Doing this here is nasty, find a better way.
LLWebSharing::instance().setOpenIDCookie(sOpenIDCookie);
+
+ // Do a web profile get so we can store the cookie
+ LLSD headers = LLSD::emptyMap();
+ headers["Accept"] = "*/*";
+ headers["Cookie"] = sOpenIDCookie;
+ headers["User-Agent"] = getCurrentUserAgent();
+
+ std::string profile_url = getProfileURL("");
+ LLURL raw_profile_url( profile_url.c_str() );
+
+ LLHTTPClient::get(profile_url,
+ new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()),
+ headers);
}
}
@@ -1833,17 +1885,12 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
media_source->ignore_ssl_cert_errors(true);
}
- // NOTE: Removed as per STORM-927 - SSL handshake failed - setting local self-signed certs like this
- // seems to screw things up big time. For now, devs will need to add these certs locally and Qt will pick them up.
-// // start by assuming the default CA file will be used
-// std::string ca_path = gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "lindenlab.pem" );
-// // default turned off so pick up the user specified path
-// if( ! gSavedSettings.getBOOL("BrowserUseDefaultCAFile"))
-// {
-// ca_path = gSavedSettings.getString("BrowserCAFilePath");
-// }
-// // set the path to the CA.pem file
-// media_source->addCertificateFilePath( ca_path );
+ // the correct way to deal with certs it to load ours from CA.pem and append them to the ones
+ // Qt/WebKit loads from your system location.
+ // Note: This needs the new CA.pem file with the Equifax Secure Certificate Authority
+ // cert at the bottom: (MIIDIDCCAomgAwIBAgIENd70zzANBg)
+ std::string ca_path = gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "CA.pem" );
+ media_source->addCertificateFilePath( ca_path );
media_source->proxy_setup(gSavedSettings.getBOOL("BrowserProxyEnabled"), gSavedSettings.getString("BrowserProxyAddress"), gSavedSettings.getS32("BrowserProxyPort"));