d81a994fc5b713f0bafc32923e44d29c872c720b
angie
  Fri Jul 29 16:18:55 2016 -0700
Added a new hg.conf setting, login.https, so that mirror sites can turn off https for hgLogin if they don't support https (they really should).  refs #17778 note-7

diff --git src/hg/hgLogin/hgLogin.c src/hg/hgLogin/hgLogin.c
index 37911b3..34c15ec 100644
--- src/hg/hgLogin/hgLogin.c
+++ src/hg/hgLogin/hgLogin.c
@@ -1380,22 +1380,23 @@
   "    hgLogin <various CGI settings>\n"
   );
 }
 
 int main(int argc, char *argv[])
 /* Process command line. */
 {
 long enteredMainTime = clock1000();
 pushCarefulMemHandler(100000000);
 setUdcCacheDir();
 cgiSpoof(&argc, argv);
 htmlSetStyleSheet("../style/userAccounts.css");
 htmlSetStyle(htmlStyleUndecoratedLink);
 htmlSetBgColor(HG_CL_OUTSIDE);
 htmlSetFormClass("accountScreen");
-struct dyString *dy = dyStringCreate("https://%s%shgLogin", wikiLinkHost(), cgiScriptDirUrl());
+struct dyString *dy = dyStringCreate("http%s://%s%shgLogin",
+                                     loginUseHttps() ? "s" : "", wikiLinkHost(), cgiScriptDirUrl());
 hgLoginUrl = dyStringCannibalize(&dy);
 oldCart = hashNew(10);
 cartHtmlShell("Login - UCSC Genome Browser", doMiddle, hUserCookie(), excludeVars, oldCart);
 cgiExitTime("hgLogin", enteredMainTime);
 return 0;
 }