avnav icon indicating copy to clipboard operation
avnav copied to clipboard

Add a parameter to the signalk plugin to choose between http and https

Open mhomeijer69 opened this issue 3 years ago • 8 comments

In the signalk plugin, http is hardcoded. Could you add an option to the plugin to choose http or https? When I change the plugin in my avnav setup to connect to a secured signalk instance, it's working.

mhomeijer69 avatar Jan 08 '22 15:01 mhomeijer69

@mhomeijer69 could you send us output of curl https://server:port/signalk if your server has self-signed certificate, you should use option "-k" for curl

free-x avatar Jan 08 '22 21:01 free-x

The output is: {"endpoints":{"v1":{"version":"1.40.0","signalk-http":"https://signalk.yachtsymbiant.net:3443/signalk/v1/api/","signalk-ws":"wss://signalk.y achtsymbiant.net:3443/signalk/v1/stream","signalk-tcp":"tcp://signalk.yachtsymbiant.net:8375"}},"server":{"id":"signalk-server-node","versio n":"1.40.0"}}

mhomeijer69 avatar Jan 09 '22 16:01 mhomeijer69

OK, will have a look at this.

wellenvogel avatar Jan 09 '22 17:01 wellenvogel

I see signalk data coming in in AvNav, but when I change the layout of AvNav, I can't select any signalk data. Could this be related to https or could something else be wrong here?

mhomeijer69 avatar Feb 20 '22 18:02 mhomeijer69

Not sure how your setup looks like. How do you see data coming in to AvNav?

wellenvogel avatar Feb 20 '22 19:02 wellenvogel

By adding debug statements in the signalk plugin.py: 2022-02-20 20:27:35,778-16338-16387-signalk-websocket-INFO-Add data gps.signalk.navigation.speedOverGround, 4.1670010556402675

mhomeijer69 avatar Feb 20 '22 19:02 mhomeijer69

Could you just send the full debug output - and maybe some trace from the web access?

wellenvogel avatar Feb 21 '22 21:02 wellenvogel

Okay, forget that last one. I was confused by the fact that some widgets (like COG) only use the internal value and not the signal k value. Sorry for the confusion.

Conclusion so far that if you put https in the signalk url, get the signalk certificate validated (probably needs a library) or disable the verification (_create_unverified_context), the signalk plugin will run against an ssl signalk server. Next goal is to get avnav behind https.

mhomeijer69 avatar Feb 24 '22 18:02 mhomeijer69