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

Convert to https #63

Closed
wants to merge 16 commits into from
Closed

Convert to https #63

wants to merge 16 commits into from

Conversation

wesleypayton
Copy link
Collaborator

Fixes #54

Problem

We need the local FocusAPI to be able to deploy under https for a more secure connection. The FocusApp will need changes to accommodate an https connection to the API with a self-signed SSL certificate.

Definition of Done

  • The FocusAPI can be deployed using https without issue
  • The FocusApp can communicate with the API while its deployed using https
  • The FocusAPI shouldn't have an unsafe connection in the swagger browser window (meaning self-signed certificate is validated)

Solution

  • The unsafe connection was fixed by changing the API's urls to use "localhost" rather than "127.0.0.1," which while functionally the same, does not match the "localhost" name contained in the auto-generated SSL certificate
  • A new helper class DevHttpHelperExtensions has been added to setup the HttpClient to handle https connections and self-signed certificates properly in an android dev environment
  • In addition, setup was added so that once we have the FocusAPI deployed on a server and accessible remotely, we can configure the URL in FocusApp quickly.

Documentation

Changes and additions are located here
https://github.com/ChrispyPeaches/FocusFriends/wiki/Consuming-API-from-the-MAUI-Application

How was this tested?

Tested locally by myself and Chris. Deployed API under https and then launched FocusApp and communicated with API via the shop page.

@iggy808
Copy link
Collaborator

iggy808 commented Mar 21, 2024

LGTM!

iggy808
iggy808 previously approved these changes Mar 21, 2024
Copy link
Owner

@ChrispyPeaches ChrispyPeaches left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the https isn't working on the TEST environment. I think it'd be a good idea for this to be implemented by this story since the point of the HTTPS stuff is for deployment purposes.

I tested this by setting the app the launch in the Release configuration and changing the API url to the https one (https://test.zenpxl.com:25566)

I committed some changes to see if it would work automatically without manually putting the certificate on Portainer, but I got an error about no certificate being configured/installed.

  • These changes on this branch have since been reverted, but are still in the committ history for reference

@ChrispyPeaches
Copy link
Owner

ChrispyPeaches commented May 3, 2024

Closing due to stale PR and since it is a lower priority

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rework Focus API to deploy under https instead of http
3 participants