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

window.crypto.subtle is undefined when saving note #73

Closed
plmdie opened this issue Mar 2, 2022 · 13 comments
Closed

window.crypto.subtle is undefined when saving note #73

plmdie opened this issue Mar 2, 2022 · 13 comments

Comments

@plmdie
Copy link

plmdie commented Mar 2, 2022

Hi, as the title says i get this error when trying to save a note.
Tried to run in docker and with yarn, same result.
Thanks in advance

@muety
Copy link
Owner

muety commented Mar 2, 2022

What browser (and version) are you using?

@plmdie
Copy link
Author

plmdie commented Mar 2, 2022

Firefox 97.0

@muety
Copy link
Owner

muety commented Mar 2, 2022

That's weird, I can't reproduce that error. Can you please show a screenshot of your DevTool's console? And can you please try in a different browser and / or incognito window?

@plmdie
Copy link
Author

plmdie commented Mar 2, 2022

incognito is the same
here:
image

@plmdie
Copy link
Author

plmdie commented Mar 2, 2022

Tried Brave browser, different error.
Screenshot:
image

@muety
Copy link
Owner

muety commented Mar 3, 2022

Can you please try whether the demo instance (link in the readme) is working for you?

@plmdie
Copy link
Author

plmdie commented Mar 3, 2022

Yes, it works fine.

@muety
Copy link
Owner

muety commented Mar 3, 2022

Alright, so I learned that window.crypto.subtle is indeed intended to be undefined when not serving the page via HTTPS.

Didn't know about that, so thanks for bringing this up!

I guess the only solution for you would then be to use TLS encryption (with a self-signed cert), as described at https://github.com/muety/mininote#use-https-for-backend.

@muety muety changed the title windows.crypto.subtle is undefined when saving note window.crypto.subtle is undefined when saving note Mar 3, 2022
@plmdie
Copy link
Author

plmdie commented Mar 3, 2022

Ok, thanks for checking that up for me, can you just explain me this step?

-Launch the backend server -> To switch back to the HTTP server, nullify either field and relaunch again.

Thanks once again

@muety
Copy link
Owner

muety commented Mar 3, 2022

Yes, so first, create a certificate (and private key), as described here for Linux (for Windows, best use the Linux subsystem to create the cert and then copy over the files to your Windows filesystem). Then point the two HTTPS_* variables in config.js to the respective files. To disable HTTPS again, clear one or both.

@plmdie
Copy link
Author

plmdie commented Mar 3, 2022

Ok, i'm already using Ubuntu, and i'm aware of the procedure for creating the certificate, it was just the "nullify either field" that i didn't got.
Thanks a lot for the quick replies.
Mininote will make a nice addition to my server app package!!

@plmdie
Copy link
Author

plmdie commented Mar 3, 2022

I don't know if i should open another issue, but if you say so i'll do it.
Everything is working fine with SSL certificate but i've run into another issue, when on Android, there's no save icon, so it's impossible to save notes.

@muety
Copy link
Owner

muety commented Mar 3, 2022

Please open another issue, preferably with OS- and browser version and a screenshot.

@muety muety closed this as completed Mar 3, 2022
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

No branches or pull requests

2 participants