The community forums are in BETA and closed to the public.

Javascript, https problem

My website at https://mywebsite links to

I then do a simple var nub = PUBNUB.init(pubnub_setup); in javascript with a custom nub.time function as well.

I receive this error in chrome console: "Mixed Content: The page at 'https://mywebsite' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ''. This request has been blocked; the content must be served over HTTPS."

Do I need to specify a config variable to use only HTTPS endpoints on pubnub's end?

If the javascript is running from https:// you need to initialize with ssl set to true, here is a quick snippet which achieves this:

var pubnub = PUBNUB.init({
  subscribe_key: 'demo',
  publish_key: 'demo',
  ssl : (('https:' == document.location.protocol) ? true : false)

You can find more information abou this in our javascript sdk documentation:

I marked this as answered because that seemed obvious and simple enough, but even with this set, I still receive the same error messages.

It's possible you're using an older version of the SDK, I just tried with 3.7.10 and it establishes the time request just fine, try this : and make sure that any init calls in your code are configuring ssl to be true.

Login or Signup to post a comment