Reputation: 371
My site is protected With SSL when i try to call XMPP Chat server is showing this error.
Mixed Content: The page at 'https://localhost:44300/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://192.168.30.1:5280/http-bind/'. This request has been blocked; the content must be served over HTTPS.
how to add ssl to ejabberd/XMPP chat server
pls Help Me am new to this
Upvotes: 1
Views: 220
Reputation: 18346
The reason why you have Mixed Content issue is not only because you did not setup ssl on your ejabberd server.
Actually it says about other issue:
So that's why you see this issue.
How to fix?
You need to access your ejabberd server by secure endpoint (HTTPS), so you should have this url https://192.168.30.1:5280/http-bind/ in your JS app code.
I'm not familiar with jsxc, but I found this getting started guide https://github.com/jsxc/jsxc/wiki/Install-jsxc#2-configure so your config should have HTTPS instead of HTTP, e.g:
xmpp: {
url: 'https://localhost:5280/http-bind/',
After this, your Mixed Content issue should be resolved.
Probably, after it, you will face another issue that you did not setup SSL for your ejabberd server, but it relates to your ejabberd server config and not to your JS app.
Upvotes: 1
Reputation: 4120
how to add ssl to ejabberd/XMPP chat server
I think you need the option tls: true and the option certfile: ... Try something like this:
listen:
-
port: 5280
module: ejabberd_http
request_handlers:
"/ws": ejabberd_http_ws
"/bosh": mod_bosh
"/api": mod_http_api
"/presence": mod_webpresence
web_admin: true
tls: true
certfile: "/etc/ejabberd/server.pem"
Upvotes: 1