YunoHost-Apps / vpnclient_ynh

VPN Client app for YunoHost
GNU Affero General Public License v3.0
41 stars 25 forks source link

Infinite loop when crt or key file isn't readable by the browser #3

Closed sbadia closed 9 years ago

sbadia commented 9 years ago

Tested with iceweasel on debian jessie (31.3.0esr-1), when I upload a client.key not readable be me (the current user) vpnclient doesn't show an error message (input validation) but this lead to an infinite loop.

jvaubourg commented 9 years ago

There is no infinite loop in this case, because actually, Firefox does not really submit the form. The page is not loading and there is just a GIF close to the button giving this impression. The browser should fail with a message and not silently, but this is an opened bug in Firefox. I'd not found a way to work around this problem because nothing indicates to javascript that the submit failed. The only one solution is to send data through AJAX, with a file uploader (a jquery plugin) for the certificates. This implies many changes and risks of incompatibility, just for working around this bug of Firefox. Instead, I just add a Tooltip on the file browsing button for asking to check if the browser is able to read the key file. Please, reopen this bug if someone has a better solution.