CORS: accessing HTTP from HTTPS

Hi Devs

Sorry, I’m running into all kinds of issues with CORS today:

Mixed Content: The page at 'https://my-source-page.html ’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://my-dhis2-analytics-call.json?etc '. This request has been blocked; the content must be served over HTTPS.

Any suggestions for amending my ajax call below? I’m accessing http from https, guessing my headers:need to be configured correctly:

		 $.ajax({

			url: base + dxAPI,

			headers: { "Authorization": 'Basic ' + btoa(user + ':' + pwd) },

			timeout: 30000,

			crossDomain: true,

			success : function(data){ ...etc

Works wonderfully from regular HTTP.

Regards,

Greg

···

Health Information Systems Program - South Africa

**- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - **

Mobile : 073 246 2992
Landline: 021 851 2216

Skype: gregory_rowles

Maybe http://my-dhis2-analytics-call.json/?etc needs to be https://my-dhis2-analytics-call.json/?etc ?

···

On Thu, Sep 29, 2016 at 1:09 PM, Greg Rowles greg.rowles@gmail.com wrote:

Hi Devs

Sorry, I’m running into all kinds of issues with CORS today:

Mixed Content: The page at 'https://my-source-page.html ’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://my-dhis2-analytics-call.json?etc '. This request has been blocked; the content must be served over HTTPS.

Any suggestions for amending my ajax call below? I’m accessing http from https, guessing my headers:need to be configured correctly:

  	 $.ajax({
  		url: base + dxAPI,
  		headers: { "Authorization": 'Basic ' + btoa(user + ':' + pwd) },
  		timeout: 30000,
  		crossDomain: true,
  		success : function(data){ ...etc

Works wonderfully from regular HTTP.

Regards,

Greg

Health Information Systems Program - South Africa

**- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - **

Mobile : 073 246 2992
Landline: 021 851 2216

Skype: gregory_rowles


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

Hi Jason

I’m not clued up on server configurations but I tried swapping http to https - it’s unsupported. I was hoping there’s an easy ajax header setting i need to add. As per your suggestion - i’ll ask the guys to enable https for that server…

Kind Regards,

Greg

···

On Thu, Sep 29, 2016 at 1:38 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Maybe http://my-dhis2-analytics-call.json/?etc needs to be https://my-dhis2-analytics-call.json/?etc ?

On Thu, Sep 29, 2016 at 1:09 PM, Greg Rowles greg.rowles@gmail.com wrote:

Hi Devs

Sorry, I’m running into all kinds of issues with CORS today:

Mixed Content: The page at 'https://my-source-page.html ’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://my-dhis2-analytics-call.json?etc '. This request has been blocked; the content must be served over HTTPS.

Any suggestions for amending my ajax call below? I’m accessing http from https, guessing my headers:need to be configured correctly:

  	 $.ajax({
  		url: base + dxAPI,
  		headers: { "Authorization": 'Basic ' + btoa(user + ':' + pwd) },
  		timeout: 30000,
  		crossDomain: true,
  		success : function(data){ ...etc

Works wonderfully from regular HTTP.

Regards,

Greg

Health Information Systems Program - South Africa

**- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - **

Mobile : 073 246 2992
Landline: 021 851 2216

Skype: gregory_rowles


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

Health Information Systems Program - South Africa

**- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - **

Mobile : 073 246 2992
Landline: 021 851 2216

Skype: gregory_rowles