-
Notifications
You must be signed in to change notification settings - Fork 138
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
update Carelink EU with issue#18 #1
Conversation
@benceszasz, I'm sorry to keep bouncing your around between issues. I can share ability to update the code with other collaborators in this area. There's a dev branch here, if you have ability to check out and test it, it would help a lot. I've been running on commandline like:
But my actual user name and password have been redacted with I haven't been able to test this because I'm in the states and can't verify the login sequence with my account. There are actually three URLs involved, the third URL comes after the initial login url but before the data service URL. Since the other two have changed, I suspect this one has as well. Once we can confirm working, I can issue a release based on this community edition repo. |
@bewest There are really major changes, not just the URLs. Sorry if it was misleading, but I just wanted to highlight the areas of the changes. I am still working on to reproduce the proper minimal HTTP communication required for login + data fetch and I am open for additional help :) I see clearly now only the end. Request The Response Below a sample working HTTP request / response for the data service: carelink_eu-data-request.txt I have removed the personal information from the response. Also please note, that the SGV values are all 0, because I only have a currently not used GC CareLink account. |
I made an account just for this. Here are several Archive 20-06-28 14-37-35.txt |
I've got basic description of the new auth flow here https://gist.github.com/bewest/47ad913fdd571531604dc23942d73b94 These changes are substantial enough to put in a new file, |
When running this version I get following errors: [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: carelink.minimed.eu. is not in the cert's altnames: DNS:mdtlogin.medtronic.com, DNS:mdtsts.medtronic.com May be just something in my config, just letting you know. |
Correct, this is just prep work to stub out space for a solution and get it released. It is open and unresolved currently. The new flow to be implemented is described here: https://gist.github.com/bewest/47ad913fdd571531604dc23942d73b94 I've gotten past the TLS CERT error now and am working through initial set of 3 redirects to the login form. They appear to employ a variety of layers of session management to establish a valid session that will require a bit more interaction. Help welcome. |
@bewest I just sent an email for you with a working implementation. |
Very nice work, @FredMK! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me.
Sadly not perfect yet. For this line, needs a check that the cookie exists or not, currently the NS crashes if the cookie not exists: Cookie handling. @bewest May I ask you to code it? Maybe it would be better if the whole fetch would be in a try catch block, so all the errors can be handled without NS crash. There are a few places in my code where some error handling is required. |
Agree, but it's a strong start. Adding to your list, I have some other nits as well: TODO
|
I made some structural and error handling changes in my fork dev branch. The US version is not tested.
|
Before @FredMK's last changes I had an error in Heroku log and no BG in Nightscout. Currently, works great. Thanks! |
I can confirm that the latest changes work also - data through to Nightscout, and that is then getting picked up by xdrip :) awesome work so far! |
I get the following error in the logs: MiniMed Connect error: Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: carelink.minimed.eu. is not in the cert's altnames: DNS:mdtlogin.medtronic.com, DNS:mdtsts.medtronic.com |
@Grynn It seems that you are not using the latest version, because this problem exists in older versions. You need to set the package.json in cgm-remote-monitor with this dep: |
Hmm, I've tried that and still get the same error in the logs. What could I be doing something wrong?
2020-06-30T11:50:16.458066+00:00 app[web.1]: MiniMed Connect error: Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: carelink.minimed.eu. is not in the cert's altnames: DNS:mdtlogin.medtronic.com, DNS:mdtsts.medtronic.com |
@Grynn I made some changes in the code, please check it again. For this test please use this version |
😔 Deployed: Grynn/cgm-remote-monitor@119137d
|
confirmed working for user users as well
@Grynn I just deployed the exact same code you deployed, and the problem is now the same for my NS... yeee :) Your NS repo is ahead of the master branch, trying to figure out the exact reason. |
@FredMK you knocked out quite a chunk of work. There are few things I can tweak today, and balancing against the need to just release a hotfix:
I'm really impressed at the fantastic amount of progress you made on this. I was tempted to try a separate module that would be peers with |
Probably won't be fixed in this pull request, but just making a note based on experience. We should double check the retry logic, especially connected to getting reauthed. Eg what happens when NS is running and then password is changed in carelink web portal? Is it likely to lock an account, or send many unreasonable numbers of requests in an error condition if retrying something that won't work? |
I don't like the whole retry logic. I made some changes but it's not good at all. I have an idea, but takes some time to code it because of async. Still working on the ERR_TLS_CERT_ALTNAME_INVALID problem. |
FWIW, if it's simpler to separate the code into it's own peer module, eg |
I tried to fix the ERR_TLS_CERT_ALTNAME_INVALID error, but I cannot find a way, cannot understand why. The workaround is to use the 13.0.1 version from NS, currently this is the master branch, with this there is no problem. The problem: When using NS 13.1.0 the following problem occurs during request Some information what I tried to solve the problem (in my fork the wip branch contains some commit):
I'm using Windows so I cannot build NS correctly, is someone can take a look on it with the latest NS commit, can reproduce the problem locally, and not just on Heroku. |
testing against international servers takes longer.
@FredMK's axios refactor rebased on dev
apparently not needed anymore
Eesh... resolving this now. |
Merge conflicts have been resolved by rebasing at selected diverging points. #17 |
mddub/minimed-connect-to-nightscout#18
Outlines some major changes in EU carelink as of 28.06.2020.
This patch updates the module with the information provided.