MojoPortal and certificates

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
1/9/2015 9:29:27 AM
Gravatar
Total Posts 83

Re: MojoPortal and certificates

Works great BUT could I also add the https:// in the beginning of my www in this AllowForcingPreferredHostName? Right now it seems to only rederict from http://mywebpage.se to http://www.mywebpage.se.

I could try but I read that if it is wrong I will have to revert it with SQL script.

1/9/2015 9:34:16 AM
Gravatar
Total Posts 18439

Re: MojoPortal and certificates

host name and protocol are 2 different things, (http:// or https:// are the protocol part of the url) you cannot enter the protocol as part of the host name for preferred host name setting.

If you set the site setting to require ssl on all pages it should force redirect to https

1/9/2015 9:48:06 AM
Gravatar
Total Posts 83

Re: MojoPortal and certificates

Okay I get it, I have made the changes but when clicking the login link (https://www.mysitet.se/Secure/Login.aspx?returnurl=%2f) I get the following exception in the webbrowser(Chrome) :

 

This webpage has a redirect loop
The webpage at https://www.mysite.se/Secure/Login.aspx?returnurl=%2f has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
Learn more about this problem.
Error code: ERR_TOO_MANY_REDIRECTS
 

 

 

1/9/2015 10:00:10 AM
Gravatar
Total Posts 18439

Re: MojoPortal and certificates

that will happen if you put an incorrect preferred host name, that is why we hide that option by default.

if you fixed it in the db you need to clear the cache, ie touch web.config

before entering a preferred host name you must make sure that a direct request for that host name works, and it must be just the host name entered and no other parts of the url nor  / characters

1/9/2015 10:08:41 AM
Gravatar
Total Posts 18439

Re: MojoPortal and certificates

also by default the redirect to a preferred host name is done with a 301 permanent redirect. web browsers cache those which is another reason to avoid putting something incorrect. even if you fix it you may have trouble clearing the web browser cache and the web browser having once been redirected now has the cached redirect and it redirects itself. ie can be particularly stubborn once it caches a 301 redirect.

1/12/2015 1:54:08 AM
Gravatar
Total Posts 83

Re: MojoPortal and certificates

This is all I got in the PreferredHostName

www.sitename.se (sitename switched to the correct one).

All I needed to do to get it working was changing the SSLIsAvailable so false again.

1/15/2015 7:26:05 AM
Gravatar
Total Posts 83

Re: MojoPortal and certificates

This is the current status : 

  1. Certificate ordered and installed on webhost
  2. Set redirect preferred name to www.orbitsupport.se and no more or less
  3. Test that redirect works, and it does, if I type http:\\orbitsupport.se it will change it to www.orbitsupport.se
  4. Copy web.config from server
  5. Activate the SSLIsAvailable in web.config
  6. Copy new web.config to server
  7. Load first page(no login or register form), works great
  8. Click on login link that redirects to a page with a login form
  9. Get the following in browser

    This webpage has a redirect loop
    The webpage at https://www.mysite.se/Secure/Login.aspx?returnurl=%2f has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
    Learn more about this problem.
    Error code: ERR_TOO_MANY_REDIRECTS
  10. If I remove the SSLIsAvailable from the web.config every thing works great again becides the https. So right now I have to run the page without the certificate. Could you give me any hint where to look to solve this problem?

 

 

MojoPortal Logg

2015-01-14 01:01:34,041 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-14 01:03:15,692 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-14 01:13:21,019 INFO (null) - (null) - (null) - mojoPortal.SearchIndex.IndexWriterTask - deserialized IndexWriterTask task 
2015-01-14 01:13:21,034 INFO (null) - (null) - (null) - mojoPortal.SearchIndex.IndexWriterTask - Queued IndexWriterTask on a new thread 
2015-01-14 02:51:58,340 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-14 02:51:58,620 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-14 02:51:58,636 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-14 04:39:40,926 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-14 04:39:41,082 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-14 04:39:41,113 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-14 06:35:58,475 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-14 06:45:24,856 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-14 06:45:25,059 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-14 06:45:25,059 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-14 07:46:41,405 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-14 07:48:40,233 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-14 07:48:40,451 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-14 07:48:40,467 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-14 08:06:28,041 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-14 08:12:10,765 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-14 08:12:11,077 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-14 08:12:11,077 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-14 08:16:26,907 INFO (null) - (null) - (null) - mojoPortal.SearchIndex.IndexWriterTask - deserialized IndexWriterTask task 
2015-01-14 08:16:26,922 INFO (null) - (null) - (null) - mojoPortal.SearchIndex.IndexWriterTask - Queued IndexWriterTask on a new thread 
2015-01-14 10:00:24,907 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-14 11:13:13,147 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-14 11:13:14,286 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-14 11:13:14,286 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-14 13:53:41,011 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-14 14:37:26,932 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-14 14:37:27,120 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-14 14:37:27,135 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-14 15:18:24,809 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-14 15:18:25,246 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-14 15:18:25,246 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-14 15:50:12,137 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-14 16:00:17,927 INFO (null) - (null) - (null) - mojoPortal.SearchIndex.IndexWriterTask - deserialized IndexWriterTask task 
2015-01-14 16:00:17,927 INFO (null) - (null) - (null) - mojoPortal.SearchIndex.IndexWriterTask - Queued IndexWriterTask on a new thread 
2015-01-14 17:38:20,380 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-14 19:22:16,019 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-14 19:27:42,508 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-14 19:27:42,508 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-14 19:50:10,921 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-14 19:59:58,979 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-14 19:59:59,557 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-14 19:59:59,666 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-14 20:00:15,032 INFO (null) - (null) - (null) - mojoPortal.SearchIndex.IndexWriterTask - deserialized IndexWriterTask task 
2015-01-14 20:00:15,032 INFO (null) - (null) - (null) - mojoPortal.SearchIndex.IndexWriterTask - Queued IndexWriterTask on a new thread 
2015-01-14 23:00:57,162 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-15 01:25:24,842 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-15 01:25:25,310 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-15 01:25:25,310 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-15 01:25:25,544 INFO (null) - (null) - (null) - mojoPortal.SearchIndex.IndexWriterTask - Queued IndexWriterTask on a new thread 
2015-01-15 01:25:27,291 INFO (null) - (null) - (null) - mojoPortal.SearchIndex.IndexWriterTask - deserialized IndexWriterTask task 
2015-01-15 04:31:11,290 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-15 06:51:27,425 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-15 06:51:27,956 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-15 06:51:27,971 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-15 06:51:28,096 INFO (null) - (null) - (null) - mojoPortal.SearchIndex.IndexWriterTask - Queued IndexWriterTask on a new thread 
2015-01-15 06:51:28,861 INFO (null) - (null) - (null) - mojoPortal.SearchIndex.IndexWriterTask - deserialized IndexWriterTask task 
2015-01-15 09:12:40,585 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-15 09:12:40,881 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-15 09:12:40,881 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-15 12:13:38,316 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-15 12:19:01,933 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-15 12:19:01,948 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-15 13:20:27,217 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-15 13:20:27,545 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-15 13:20:27,638 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-15 13:25:45,131 INFO 192.168.10.100 - sv-SE - /Admin/SiteSettings.aspx - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-15 13:25:45,306 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-15 13:25:50,732 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-15 13:25:51,044 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-15 13:25:51,075 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-15 13:26:27,674 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-15 13:26:35,475 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-15 13:26:35,771 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-15 13:26:35,771 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-15 13:26:58,030 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-15 13:26:58,233 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-15 13:26:58,264 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 
2015-01-15 13:27:36,484 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-15 13:27:36,661 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End 
2015-01-15 13:27:41,996 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started. 
2015-01-15 13:27:42,371 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2015-01-15 13:27:42,371 INFO (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 

 

1/15/2015 7:33:36 AM
Gravatar
Total Posts 18439

Re: MojoPortal and certificates

when you click the login link it tries to go to a secure page, ie if configured as SSLIsAvailable the login page is protected with a redirect to https

if that is not working it means either your certificate is not installed or it does not match the preferred host name.

1/15/2015 9:09:37 AM
Gravatar
Total Posts 83

Re: MojoPortal and certificates

Thanks, the certificate are set to common name : www.orbitsupport.se we could choose just orbitsupport.se. Becouse its a certificate I supose that the https:\\ is implicit.

The certificate are from Thawte.com and are installed on the host. 

Is there any other way to check if https is working for www.orbitsupport.se?

1/15/2015 9:42:28 AM
Gravatar
Total Posts 18439

Re: MojoPortal and certificates

"Is there any other way to check if https is working for www.orbitsupport.se?"

just type in the url https://www.orbitsupport.se 

it does seem to be working for me when I try your site.

however https://orbitsupport.se does not work and you will not be able to redirect requests for that to https://www.orbitsupport.se because IIS will fail on that request since no matching certificate is found, therefore mojoportal code is never reached before IIS throws an error.

however requests for http://orbitsupport.se should be able to redirect to https://www.orbitsupport.se

only other thing that could cause a problem is if your host is doing some weird proxying

as stated before 301 redirects can be cached by the browser so you may want to try different browsers and machines to make sure whether it is working or not, cached redirects in the browser with bad settings can be causing the problem.

1/16/2015 3:02:31 AM
Gravatar
Total Posts 83

Re: MojoPortal and certificates

I have tried the following : 

https://www.orbitsupport.se/
https://www.orbitsupport.se/Default.aspx
https://www.orbitsupport.se/Secure/Login.aspx?returnurl=%2fDefault.aspx

And all of them works just fine and the login will work just fine so the certificate seems to be installed as it should. The problem are that I need to redirect all trafic from http to https and to do this I need to turn on the SSLIsAvailable.

When SSLIsAvailable is turned on and I go to http://orbitsupport.se the page will reload http://www.orbitsupport.se but it will ignore the https. This is becouse the page is not forcing https at this point, if I however click the login link I will get the same redirection exception as before but I can see that it is no forcing https(https://www.orbitsupport.se/Secure/Login.aspx?returnurl=%2f) and thats correct.

So I do still not get why I get a redirection exception but I will talk with the host and see if there is something strange there.

 

You must sign in to post in the forums. This thread is closed to new posts.