Web Connection
insecure WebSocket connection console error
Gravatar is a globally recognized avatar based on your email address. insecure WebSocket connection console error
  Richard Kaye
  All
  Dec 13, 2019 @ 11:06am

Hi Rick,

Getting things up and running (at last) in my staging environment. Whilst doing some testing I've come across this message in the browser console:

salesched.r3:1666 Mixed Content: The page at '***' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws:***:443/dev.wc'. This request has been blocked; this endpoint must be available over WSS.
(anonymous) @ salesched.r3:1666
salesched.r3:1666 Uncaught DOMException: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
    at https://***/salesched.r3:1666:18

Any thoughts?

Gravatar is a globally recognized avatar based on your email address. re: insecure WebSocket connection console error
  Rick Strahl
  Richard Kaye
  Dec 13, 2019 @ 11:56am

This is related to the new Live Reload functionality. For now, that doesn't work over https so if you are running locally on https you have to turn live reload off in web.config.

It's an item on my fix it list for the next update.

If this is a production site make doubly sure you turn live reload off 😃

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: insecure WebSocket connection console error
  Richard Kaye
  Rick Strahl
  Dec 13, 2019 @ 12:56pm

Thanks for the rapid and logical reply, Rick.
It is a stage environment at the moment and I do have live reload turned on. I do recall your instruction to not use it in a production environment. I'll turn it off now so I don't have to see the errors.

Gravatar is a globally recognized avatar based on your email address. re: insecure WebSocket connection console error
  Rick Strahl
  Richard Kaye
  Dec 13, 2019 @ 12:59pm

Right - you shouldn't need it in a staging environment. Generally Live Reload is just for development environments. Unfortunately there's no reliable way to automatically tell whether we're in dev or production. Maybe we should add a flag to the web.config settings so it's just one thing to set. But there's still the HTML mapping that has to be manually unset (can't do that via code unfortunately) as well so it's not all automatic.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: insecure WebSocket connection console error
  Richard Kaye
  Richard Kaye
  Dec 13, 2019 @ 01:03pm

Updated my web.config and re-read the configuration. Error gone!

Thanks again!

Gravatar is a globally recognized avatar based on your email address. re: insecure WebSocket connection console error
  Rick Strahl
  Richard Kaye
  Dec 14, 2019 @ 01:34am

I've updated the module and now it should work over https:// with the wss:// protocol. I've also added additional code that checks if the socket connection has been dropped (if the server is shut down) and tries to reconnect every few seconds.

https://west-wind.com/files/WebConnectionExperimental.zip

includes the webconnectionmodule.dll which has the change.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: insecure WebSocket connection console error
  Richard Kaye
  Rick Strahl
  Dec 16, 2019 @ 05:59am

Just loaded up the new DLL and re-enabled live reload. No more security/socket warnings.

© 1996-2020