InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[enhancement]: Anti-malware software interferes with installation

Open psychedelicious opened this issue 2 years ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Contact Details

No response

What should this feature add?

Some AV software (have seen AVG and Kaspersky mentioned) prevent a SSL revocation check from succeeding. The installer's curl commands then break and install fails.

We should try to figure out how to avoid this without just disabling the revocation checks (which does work) or forcing the user to disable their anti-malware software (which also does work).

See https://discord.com/channels/1020123559063990373/1044860655422943302 for some helpful investigation by @ebr.

Alternatives

No response

Aditional Content

No response

psychedelicious avatar Dec 02 '22 07:12 psychedelicious

Deactivate antivirus during installation and no problems

ffdown avatar Dec 02 '22 15:12 ffdown

From what I understand of this issue (it only effects curl) and its cause (curl using Window's (default?) non-standard secure connections for cert verification validation), the correct solution here should be setting CURL_SSL_BACKEND=openssl, which disables nothing, but rather switches curl's secure backend from Windows' to SSL's

tildebyte avatar Dec 02 '22 21:12 tildebyte

From what I understand of this issue (it only effects curl) and its cause (curl using Window's (default?) non-standard secure connections for cert verification validation), the correct solution here should be setting CURL_SSL_BACKEND=openssl, which disables nothing, but rather switches curl's secure backend from Windows' to SSL's

Is OpenSSL guaranteed to be available on windows?

psychedelicious avatar Dec 02 '22 22:12 psychedelicious

Is OpenSSL guaranteed to be available on windows?

That is a very good point. It seems that curl should be built with the openssl backend, and I don't think we can rely on that on Windows. I tried this just now on a clean Windows VM, and my curl's behaviour is unchanged with this environment var set, but I don't have any antivirus on there, so actually no idea if it had any effect. It did not break curl, so there's that.

But besides, getting users to set a Windows environment variable is probably not going to be a robust solution.

Here's another idea: curl -tlsv1.3 -L https://github.com/cmdr2/stable-diffusion-ui/releases/download/v1.1/micromamba.exe -O. -tlsv1.3 forces the use of TLSv1.3, which may tell SChannel to behave correctly. I just tried it, works, but again - no AV, so no idea if this is a fix. The inspiration for this came from a tangentially related https://stackoverflow.com/questions/41618766/powershell-invoke-webrequest-fails-with-ssl-tls-secure-channel

Finally, I'd like to test if using Invoke-WebRequest in PowerShell instead of curl in .bat might work around the issue. will report back.

ebr avatar Dec 03 '22 06:12 ebr

@ebr I wonder if PowerShell is a better shell for our installation. It's so much nicer to work in and provides a lot of wonderfully useful cmdlets. Ya know, I'm gonna just go ahead and say yes - it is a better shell for us to use - and interestingly, it is cross-platform... Maybe this is crazy, but what if we used PowerShell for all platforms?

Sorry, went a bit off topic.

psychedelicious avatar Dec 03 '22 06:12 psychedelicious

@psychedelicious;

what if we used PowerShell for all platforms?

I totally follow your logic (although I have some resevations), but... I can't do it, not in a reasonable time frame. I know almost nothing about Powershell, and every time I've tried to learn, it's broken my brain.

tildebyte avatar Dec 03 '22 19:12 tildebyte

@ebr;

getting users to set a Windows environment variable

~~Not necessary (AFAIK) - there should be a way to set that in the script just for the curl command (like e.g. setting the MPS backend thingy for Macs).~~

grr. Testing from the install script, with curl -v, indicates that curl on Windows doesn't have the OpenSSL backend.

tildebyte avatar Dec 03 '22 19:12 tildebyte

We resolved this a while back when we moved to Python-based installer.

ebr avatar May 01 '23 16:05 ebr