Skip to content
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

Fix HTTPS downloads using curl #2460

Closed
wants to merge 5 commits into from

Conversation

JonasVautherin
Copy link
Collaborator

@JonasVautherin JonasVautherin commented Dec 4, 2024

Resolves mavlink/MAVSDK-Java#192.

In a previous PR, we have built curl with ssl support. But that is not enough for Android. First, curl does not auto-detect the system certificates on Android (at least not on all versions of Android). Second, OpenSSL3 cannot parse the Android system certificates (again at least on the versions of Android we tested) and it does not seem like this will change. BoringSSL, on the other hand, works with the Android system certificates.

I don't think that we should move MAVSDK entirely to BoringSSL for different reasons, one of them being that the default ssl library on many systems is OpenSSL. However, if OpenSSL3 does not really support Android, it seems like it makes sense to move to BoringSSL. Just for Android.

@julianoes: In order for boringssl to build, I had to update grpc, which in turn forced me to update protobuf, and hence to regenerate the code 🙈
@rayw-dronesense: would you mind testing this on your setup? 🙏

@JonasVautherin JonasVautherin force-pushed the v2-curl-https-android-try-boringssl branch from d3cfea2 to 83050c1 Compare December 8, 2024 19:15
@JonasVautherin JonasVautherin changed the title Try to use boringssl instead of openssl for https on Android Fix HTTPS downloads using curl Dec 8, 2024
@JonasVautherin JonasVautherin force-pushed the v2-curl-https-android-try-boringssl branch from 83050c1 to 2e8929e Compare December 8, 2024 19:45
@rayw-dronesense
Copy link
Contributor

rayw-dronesense commented Dec 9, 2024

@JonasVautherin It works!

2024-12-09 11:55:16.190  3418-3722  Mavsdk                  com.dronesense.pilot.blue            I  Download file: https://github.com/Gremsy/Vio-Camera-Definition/releases/download/v2.0.3/vio_camera_f1_def.xml using cURL...
2024-12-09 11:55:16.195  3418-3722  Mavsdk                  com.dronesense.pilot.blue            I  Downloading camera definition from: https://github.com/Gremsy/Vio-Camera-Definition/releases/download/v2.0.3/vio_camera_f1_def.xml
2024-12-09 11:55:16.270  3418-3547  Mavsdk                  com.dronesense.pilot.blue            W  Received ack for not-existing command: 521! Ignoring...
2024-12-09 11:55:16.349  3418-3547  Mavsdk                  com.dronesense.pilot.blue            W  Received ack for not-existing command: 521! Ignoring...
2024-12-09 11:55:16.394  3418-3545  Mavsdk                  com.dronesense.pilot.blue            W  sending again after 0.507629 s, retries to do: 3  (2502).
2024-12-09 11:55:16.857  3418-3722  Mavsdk                  com.dronesense.pilot.blue            I  Downloaded file, result Success
2024-12-09 11:55:16.857  3418-3722  Mavsdk                  com.dronesense.pilot.blue            D  Successfully loaded camera definition

@JonasVautherin
Copy link
Collaborator Author

Awesome! I just need to fix the iOS/macOS build with the updated gRPC now!

@JonasVautherin JonasVautherin force-pushed the v2-curl-https-android-try-boringssl branch from e81ff8b to 93e0d54 Compare December 9, 2024 23:29
@JonasVautherin JonasVautherin force-pushed the v2-curl-https-android-try-boringssl branch from 93e0d54 to 7f76824 Compare December 10, 2024 10:03
@JonasVautherin
Copy link
Collaborator Author

Hmm with the latest version of gRPC I had to update protobuf, which means that I need to re-generate the code... I don't know how I feel about that. Trying with an older version of gRPC, see if that works.

The PR for v3 does update protobuf, though: #2460

@JonasVautherin JonasVautherin force-pushed the v2-curl-https-android-try-boringssl branch from 7f76824 to 9b90fc5 Compare December 10, 2024 10:21
This is because openssl3 does not support the system certificates on
Android and does not seem to plan to support them.
@JonasVautherin JonasVautherin force-pushed the v2-curl-https-android-try-boringssl branch from 9b90fc5 to 0ba884c Compare December 10, 2024 10:44
@JonasVautherin JonasVautherin force-pushed the v2-curl-https-android-try-boringssl branch from 0ba884c to 7305fa1 Compare December 10, 2024 10:52
@JonasVautherin JonasVautherin marked this pull request as ready for review December 10, 2024 11:02
@julianoes
Copy link
Collaborator

Closing this as I opted for simple hack for v2: #2471

@julianoes julianoes closed this Dec 12, 2024
@julianoes julianoes deleted the v2-curl-https-android-try-boringssl branch December 12, 2024 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants