-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2.1.3 Gremsy Vio camera payload fails to download camera definition due to "unsupported protocol" error #192
Comments
We build curl without ssl, I think it won't support https: https://github.com/mavlink/MAVSDK/blob/main/third_party/curl/CMakeLists.txt#L12 Would you have a way to use http instead? A weird thing in your case is that the camera definition is downloaded from the internet. Shouldn't it be served by the drone? Or is it somehow a simulator setup? |
I tried to add openssl with https support in mavlink/MAVSDK#2386 and I gave up trying to get it building for all platforms. If you want to waste a few days staring at CI playing with dependencies, feel free. I find it utterly frustrating. |
It's a real drone and payload. Nope, they for some reason decided it was a good idea to have the file fetched from Github every time; here's their documentation: https://docs.gremsy.com/payloads/vio/camera-setting-menu/camera-definition-file-download - pretty sure I have no way of changing this behavior...
Oh boy...sorry to hear about that. By any chance, were we able to get it to work on Android at least? |
Pretty sure Android was one of the broken ones: Is the file available with http though? In that case, you can just intercept (but not in Java) the message containing the URL and change Or what we could also try is to just parse |
Whoops it got resolved automatically because I mentioned it in the PR. Let me reopen it. |
Trying to backport it to v2.12 so that we can maybe release it before v3: mavlink/MAVSDK#2454 |
That's unfortunate. Thanks for the info!
Hmm... I don't think Github lets you download using HTTP anymore; here's what happens when I take that URL and do a wget with "HTTP" instead of "HTTPS":
@JonasVautherin Thanks! |
Can you try with mavsdk_server:2.1.4? Just pushed it to MavenCentral. It should support HTTPS |
@JonasVautherin - Thanks for the updated release! With 2.1.4 it does get a bit further, but runs into this issue,
|
Oh yeah, that's a good question: in order to properly leverage HTTPS, curl (openssl?) needs to have access to certificates. Usually they are found on the system, but I honestly don't know how we should do that with our static library 🤔. An easy way would be to disable the verification (see e.g. here). We could justify it by saying that downloading a wrong camera_definition.xml is not a security issue 😅. Ideally we would have a way to feed certificates to mavsdk_server though? Would you mind looking into libcurl to see if there is a way to give it certificates? Apparently the executable has some options for that (see here), but in our case we use libcurl (not the executable). The next question would be whether we can read system certificates on Android... I had not realized before, but it isn't as easy as just enabling https in curl 🙈. EDIT: here I see stuff like this:
So if we had read access to the system certificates on Android, we could maybe just use that? I checked on my device and I have certificates in |
Oh maybe we could just set CURLOPT_CAPATH to And it seems like this answer does it at build time!
|
@rayw-dronesense: would you be able to try this PR? mavlink/MAVSDK#2459 |
@JonasVautherin - Trying now... |
@JonasVautherin - I guess it makes it further now... but,
|
Gonna try doing a clean and rebuild for good measure. |
Does your device have /system/etc/security/cacerts? |
Yes it does,
|
Update: clean and rebuild didn't change anything. Still got |
Just for fun I tried disabling SSL verification per the above post...and that got it past the download definition no problem. But
|
Yeah okay, looks like the error is correct - it's getting an empty string for some reason.
The output is empty,
|
Got it. Also had to enable "Follow Location" to allow it to handle redirects,
Then it started to work,
So now it's just a matter of having the certs validate the proper way I guess |
Did you try with CURLOPT_SSL_VERIFYPEER=1 and CURLOPT_FOLLOWLOCATION=1? Maybe the error "SSL peer certificate or SSH remote key was not OK" happens on the empty string because the redirection was not followed? |
Just tried it. Same |
The text was updated successfully, but these errors were encountered: