App Installation - SSL issue

Hi,

We have set up an internal test instance of DHIS 2 that is not running via ssl. When installing apps into the instance, it is not able to load any of the apps or resources because it is redirecting to a path of https instead of http.

eg:

our website:

http://[server]

installed app is attempting to navigate to:

https://[server]/api/apps/customjscss/index.html

Is there somewhere where we need to configure this to use http? I’ve looked around but not sure if I’m missing something.

I went into the settings and set the Server Base URL for http://[server], restarted and reinstalled the apps but this didn’t fix it.

I also saw in the database there is an appBaseUrl setting in the systemsetting table but it is not in clear text so I’m not sure what it’s set to. This db was copied from another instance that is running under ssl so maybe that is the issue? I tried deleting this property, restarting and reinstalling the app but it still defaults to https.

How can we fix this?

We are using 2.22 r 21832.

Thanks,

Lorill

Hi

Could you have a look at your manifest file and see what the baseUrl is set to? for 2.22 it should just be *

···

On Wed, Feb 17, 2016 at 7:03 AM, Lorill Crees lcrees@2paths.com wrote:

Hi,

We have set up an internal test instance of DHIS 2 that is not running via ssl. When installing apps into the instance, it is not able to load any of the apps or resources because it is redirecting to a path of https instead of http.

eg:

our website:

http://[server]

installed app is attempting to navigate to:

https://[server]/api/apps/customjscss/index.html

Is there somewhere where we need to configure this to use http? I’ve looked around but not sure if I’m missing something.

I went into the settings and set the Server Base URL for http://[server], restarted and reinstalled the apps but this didn’t fix it.

I also saw in the database there is an appBaseUrl setting in the systemsetting table but it is not in clear text so I’m not sure what it’s set to. This db was copied from another instance that is running under ssl so maybe that is the issue? I tried deleting this property, restarting and reinstalling the app but it still defaults to https.

How can we fix this?

We are using 2.22 r 21832.

Thanks,

Lorill


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten

Hi Morten,

Yes - the baseUrl is set to *.

Lorill

···

On Tue, Feb 16, 2016 at 6:17 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Could you have a look at your manifest file and see what the baseUrl is set to? for 2.22 it should just be *

On Wed, Feb 17, 2016 at 7:03 AM, Lorill Crees lcrees@2paths.com wrote:

Hi,

We have set up an internal test instance of DHIS 2 that is not running via ssl. When installing apps into the instance, it is not able to load any of the apps or resources because it is redirecting to a path of https instead of http.

eg:

our website:

http://[server]

installed app is attempting to navigate to:

https://[server]/api/apps/customjscss/index.html

Is there somewhere where we need to configure this to use http? I’ve looked around but not sure if I’m missing something.

I went into the settings and set the Server Base URL for http://[server], restarted and reinstalled the apps but this didn’t fix it.

I also saw in the database there is an appBaseUrl setting in the systemsetting table but it is not in clear text so I’m not sure what it’s set to. This db was copied from another instance that is running under ssl so maybe that is the issue? I tried deleting this property, restarting and reinstalling the app but it still defaults to https.

How can we fix this?

We are using 2.22 r 21832.

Thanks,

Lorill


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten

Hm, ok. I haven’t seen that issue before. So the app shows up, just that the link in the menu is wrong? What if you go there directly, /api/apps/{app-name} ?

···

On Wed, Feb 17, 2016 at 12:08 PM, Lorill Crees lcrees@2paths.com wrote:

Hi Morten,

Yes - the baseUrl is set to *.

Lorill

On Tue, Feb 16, 2016 at 6:17 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Could you have a look at your manifest file and see what the baseUrl is set to? for 2.22 it should just be *

On Wed, Feb 17, 2016 at 7:03 AM, Lorill Crees lcrees@2paths.com wrote:

Hi,

We have set up an internal test instance of DHIS 2 that is not running via ssl. When installing apps into the instance, it is not able to load any of the apps or resources because it is redirecting to a path of https instead of http.

eg:

our website:

http://[server]

installed app is attempting to navigate to:

https://[server]/api/apps/customjscss/index.html

Is there somewhere where we need to configure this to use http? I’ve looked around but not sure if I’m missing something.

I went into the settings and set the Server Base URL for http://[server], restarted and reinstalled the apps but this didn’t fix it.

I also saw in the database there is an appBaseUrl setting in the systemsetting table but it is not in clear text so I’m not sure what it’s set to. This db was copied from another instance that is running under ssl so maybe that is the issue? I tried deleting this property, restarting and reinstalling the app but it still defaults to https.

How can we fix this?

We are using 2.22 r 21832.

Thanks,

Lorill


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten

Morten

Yes - I can go directly to the app if I change the url to http, but within the apps other things related to urls are messed up. The icons in the app menu for manually installed apps also point to https so they don’t show up, but I can manually navigate to the icons by using the url with http. The native DHIS 2 apps are all fine and properly reference http.

Another thing I’ve just noticed is that when pulling up http://[server]/api/resources, all the “href” resource elements are incorrectly referencing https.

···

On Tue, Feb 16, 2016 at 9:20 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hm, ok. I haven’t seen that issue before. So the app shows up, just that the link in the menu is wrong? What if you go there directly, /api/apps/{app-name} ?

On Wed, Feb 17, 2016 at 12:08 PM, Lorill Crees lcrees@2paths.com wrote:

Hi Morten,

Yes - the baseUrl is set to *.

Lorill

Morten

On Tue, Feb 16, 2016 at 6:17 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Could you have a look at your manifest file and see what the baseUrl is set to? for 2.22 it should just be *

On Wed, Feb 17, 2016 at 7:03 AM, Lorill Crees lcrees@2paths.com wrote:

Hi,

We have set up an internal test instance of DHIS 2 that is not running via ssl. When installing apps into the instance, it is not able to load any of the apps or resources because it is redirecting to a path of https instead of http.

eg:

our website:

http://[server]

installed app is attempting to navigate to:

https://[server]/api/apps/customjscss/index.html

Is there somewhere where we need to configure this to use http? I’ve looked around but not sure if I’m missing something.

I went into the settings and set the Server Base URL for http://[server], restarted and reinstalled the apps but this didn’t fix it.

I also saw in the database there is an appBaseUrl setting in the systemsetting table but it is not in clear text so I’m not sure what it’s set to. This db was copied from another instance that is running under ssl so maybe that is the issue? I tried deleting this property, restarting and reinstalling the app but it still defaults to https.

How can we fix this?

We are using 2.22 r 21832.

Thanks,

Lorill


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten

Ok, sounds like you have a misconfigured reverse proxy? How is the internal instance set up? is it directly tomcat, or do you have apache or nginx in front of it?

···

On Wed, Feb 17, 2016 at 12:35 PM, Lorill Crees lcrees@2paths.com wrote:

Yes - I can go directly to the app if I change the url to http, but within the apps other things related to urls are messed up. The icons in the app menu for manually installed apps also point to https so they don’t show up, but I can manually navigate to the icons by using the url with http. The native DHIS 2 apps are all fine and properly reference http.

Another thing I’ve just noticed is that when pulling up http://[server]/api/resources, all the “href” resource elements are incorrectly referencing https.

On Tue, Feb 16, 2016 at 9:20 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hm, ok. I haven’t seen that issue before. So the app shows up, just that the link in the menu is wrong? What if you go there directly, /api/apps/{app-name} ?

On Wed, Feb 17, 2016 at 12:08 PM, Lorill Crees lcrees@2paths.com wrote:

Hi Morten,

Yes - the baseUrl is set to *.

Lorill

Morten

On Tue, Feb 16, 2016 at 6:17 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Could you have a look at your manifest file and see what the baseUrl is set to? for 2.22 it should just be *

On Wed, Feb 17, 2016 at 7:03 AM, Lorill Crees lcrees@2paths.com wrote:

Hi,

We have set up an internal test instance of DHIS 2 that is not running via ssl. When installing apps into the instance, it is not able to load any of the apps or resources because it is redirecting to a path of https instead of http.

eg:

our website:

http://[server]

installed app is attempting to navigate to:

https://[server]/api/apps/customjscss/index.html

Is there somewhere where we need to configure this to use http? I’ve looked around but not sure if I’m missing something.

I went into the settings and set the Server Base URL for http://[server], restarted and reinstalled the apps but this didn’t fix it.

I also saw in the database there is an appBaseUrl setting in the systemsetting table but it is not in clear text so I’m not sure what it’s set to. This db was copied from another instance that is running under ssl so maybe that is the issue? I tried deleting this property, restarting and reinstalling the app but it still defaults to https.

How can we fix this?

We are using 2.22 r 21832.

Thanks,

Lorill


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten

Morten

Hi Lorill,
I think you need to modify the Tomcat server.xml file to get this to work properly.

I usually add an additional connector

<Connector port=“8090” protocol=“HTTP/1.1” proxyPort=“443” scheme=“https”

connectionTimeout=“20000”

URIEncoding=“UTF-8”

redirectPort=“8443” />

and then point the reverse proxy to that.

Regards

Jason

···

On Wed, Feb 17, 2016 at 6:40 AM, Morten Olav Hansen morten@dhis2.org wrote:

Ok, sounds like you have a misconfigured reverse proxy? How is the internal instance set up? is it directly tomcat, or do you have apache or nginx in front of it?


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Feb 17, 2016 at 12:35 PM, Lorill Crees lcrees@2paths.com wrote:

Yes - I can go directly to the app if I change the url to http, but within the apps other things related to urls are messed up. The icons in the app menu for manually installed apps also point to https so they don’t show up, but I can manually navigate to the icons by using the url with http. The native DHIS 2 apps are all fine and properly reference http.

Another thing I’ve just noticed is that when pulling up http://[server]/api/resources, all the “href” resource elements are incorrectly referencing https.

Morten

On Tue, Feb 16, 2016 at 9:20 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hm, ok. I haven’t seen that issue before. So the app shows up, just that the link in the menu is wrong? What if you go there directly, /api/apps/{app-name} ?

On Wed, Feb 17, 2016 at 12:08 PM, Lorill Crees lcrees@2paths.com wrote:

Hi Morten,

Yes - the baseUrl is set to *.

Lorill

Morten

On Tue, Feb 16, 2016 at 6:17 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Could you have a look at your manifest file and see what the baseUrl is set to? for 2.22 it should just be *

On Wed, Feb 17, 2016 at 7:03 AM, Lorill Crees lcrees@2paths.com wrote:

Hi,

We have set up an internal test instance of DHIS 2 that is not running via ssl. When installing apps into the instance, it is not able to load any of the apps or resources because it is redirecting to a path of https instead of http.

eg:

our website:

http://[server]

installed app is attempting to navigate to:

https://[server]/api/apps/customjscss/index.html

Is there somewhere where we need to configure this to use http? I’ve looked around but not sure if I’m missing something.

I went into the settings and set the Server Base URL for http://[server], restarted and reinstalled the apps but this didn’t fix it.

I also saw in the database there is an appBaseUrl setting in the systemsetting table but it is not in clear text so I’m not sure what it’s set to. This db was copied from another instance that is running under ssl so maybe that is the issue? I tried deleting this property, restarting and reinstalling the app but it still defaults to https.

How can we fix this?

We are using 2.22 r 21832.

Thanks,

Lorill


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

1 Like

Hi Lorill,

DHIS 2 is looking at a header in the web request called X-Forwarded-Proto when determining the protocol.

Are you running behind nginx? Could you check that this directive is part of the location block which proxy passes to Tomcat? Or, at least make sure this directive is not set to https (defaults to http).

proxy_set_header X-Forwarded-Proto http;
···

best regards,

Lars

On Wed, Feb 17, 2016 at 1:27 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Lorill,
I think you need to modify the Tomcat server.xml file to get this to work properly.

I usually add an additional connector

<Connector port=“8090” protocol=“HTTP/1.1” proxyPort=“443” scheme=“https”

connectionTimeout=“20000”

URIEncoding=“UTF-8”

redirectPort=“8443” />

and then point the reverse proxy to that.

Regards

Jason


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Feb 17, 2016 at 6:40 AM, Morten Olav Hansen morten@dhis2.org wrote:

Ok, sounds like you have a misconfigured reverse proxy? How is the internal instance set up? is it directly tomcat, or do you have apache or nginx in front of it?


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On Wed, Feb 17, 2016 at 12:35 PM, Lorill Crees lcrees@2paths.com wrote:

Yes - I can go directly to the app if I change the url to http, but within the apps other things related to urls are messed up. The icons in the app menu for manually installed apps also point to https so they don’t show up, but I can manually navigate to the icons by using the url with http. The native DHIS 2 apps are all fine and properly reference http.

Another thing I’ve just noticed is that when pulling up http://[server]/api/resources, all the “href” resource elements are incorrectly referencing https.

Morten

On Tue, Feb 16, 2016 at 9:20 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hm, ok. I haven’t seen that issue before. So the app shows up, just that the link in the menu is wrong? What if you go there directly, /api/apps/{app-name} ?

On Wed, Feb 17, 2016 at 12:08 PM, Lorill Crees lcrees@2paths.com wrote:

Hi Morten,

Yes - the baseUrl is set to *.

Lorill

Morten

On Tue, Feb 16, 2016 at 6:17 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Could you have a look at your manifest file and see what the baseUrl is set to? for 2.22 it should just be *

On Wed, Feb 17, 2016 at 7:03 AM, Lorill Crees lcrees@2paths.com wrote:

Hi,

We have set up an internal test instance of DHIS 2 that is not running via ssl. When installing apps into the instance, it is not able to load any of the apps or resources because it is redirecting to a path of https instead of http.

eg:

our website:

http://[server]

installed app is attempting to navigate to:

https://[server]/api/apps/customjscss/index.html

Is there somewhere where we need to configure this to use http? I’ve looked around but not sure if I’m missing something.

I went into the settings and set the Server Base URL for http://[server], restarted and reinstalled the apps but this didn’t fix it.

I also saw in the database there is an appBaseUrl setting in the systemsetting table but it is not in clear text so I’m not sure what it’s set to. This db was copied from another instance that is running under ssl so maybe that is the issue? I tried deleting this property, restarting and reinstalling the app but it still defaults to https.

How can we fix this?

We are using 2.22 r 21832.

Thanks,

Lorill


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

http://www.dhis2.org

Thanks all for your help with this. I will take a look at the config pieces you mentioned.

Cheers,

Lorill

···

On Wed, Feb 17, 2016 at 4:08 AM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Lorill,

DHIS 2 is looking at a header in the web request called X-Forwarded-Proto when determining the protocol.

Are you running behind nginx? Could you check that this directive is part of the location block which proxy passes to Tomcat? Or, at least make sure this directive is not set to https (defaults to http).

proxy_set_header X-Forwarded-Proto http;

Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

best regards,

Lars

On Wed, Feb 17, 2016 at 1:27 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Lorill,
I think you need to modify the Tomcat server.xml file to get this to work properly.

I usually add an additional connector

<Connector port=“8090” protocol=“HTTP/1.1” proxyPort=“443” scheme=“https”

connectionTimeout=“20000”

URIEncoding=“UTF-8”

redirectPort=“8443” />

and then point the reverse proxy to that.

Regards

Jason


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

http://www.dhis2.org

On Wed, Feb 17, 2016 at 6:40 AM, Morten Olav Hansen morten@dhis2.org wrote:

Ok, sounds like you have a misconfigured reverse proxy? How is the internal instance set up? is it directly tomcat, or do you have apache or nginx in front of it?


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On Wed, Feb 17, 2016 at 12:35 PM, Lorill Crees lcrees@2paths.com wrote:

Yes - I can go directly to the app if I change the url to http, but within the apps other things related to urls are messed up. The icons in the app menu for manually installed apps also point to https so they don’t show up, but I can manually navigate to the icons by using the url with http. The native DHIS 2 apps are all fine and properly reference http.

Another thing I’ve just noticed is that when pulling up http://[server]/api/resources, all the “href” resource elements are incorrectly referencing https.

Morten

On Tue, Feb 16, 2016 at 9:20 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hm, ok. I haven’t seen that issue before. So the app shows up, just that the link in the menu is wrong? What if you go there directly, /api/apps/{app-name} ?

On Wed, Feb 17, 2016 at 12:08 PM, Lorill Crees lcrees@2paths.com wrote:

Hi Morten,

Yes - the baseUrl is set to *.

Lorill

Morten

On Tue, Feb 16, 2016 at 6:17 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Could you have a look at your manifest file and see what the baseUrl is set to? for 2.22 it should just be *

On Wed, Feb 17, 2016 at 7:03 AM, Lorill Crees lcrees@2paths.com wrote:

Hi,

We have set up an internal test instance of DHIS 2 that is not running via ssl. When installing apps into the instance, it is not able to load any of the apps or resources because it is redirecting to a path of https instead of http.

eg:

our website:

http://[server]

installed app is attempting to navigate to:

https://[server]/api/apps/customjscss/index.html

Is there somewhere where we need to configure this to use http? I’ve looked around but not sure if I’m missing something.

I went into the settings and set the Server Base URL for http://[server], restarted and reinstalled the apps but this didn’t fix it.

I also saw in the database there is an appBaseUrl setting in the systemsetting table but it is not in clear text so I’m not sure what it’s set to. This db was copied from another instance that is running under ssl so maybe that is the issue? I tried deleting this property, restarting and reinstalling the app but it still defaults to https.

How can we fix this?

We are using 2.22 r 21832.

Thanks,

Lorill


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten